Mega crashed quite weirdly during site generation and flushed the entire transaction that I had done.
Is there any way to reverse a flushed transaction?
If the transaction has been discarded there is no way to recover it. However, if MEGA crashed, the transaction file is normally still there when you login again. By default MEGA saves every 5 minutes your work into a transaction logfile on the server, when the tool crashes, the logfile will be recovered and you only lose 5 minutes of work.
Note that the MEGA application will NOT dispatch a transaction automatically even it an crash occurs.
Besides, a static web site generation is mainly a creation of html files on the disk and not not is itself update repository objects.
If an error has occurs during the work in a transaction (not during the dispatch processing), you should be able to resume the transaction and to abandon it (Menu File >Discard)
If you have triggered the dispatch, transaction update should be commited (as expected).
There is not feature to reverse the updates automatically. You need to perform updates that returm to the initial situation.
Of course you can also decide to restore a previous state of data using physical backups.