Every single public company maintains records on an immutable database. with Sarbanes Oxley this is a requirement.
The simple answer is you create a system but undoes the ledger not by deleting but by noting the change. Have a look how Oracle databases work now. When you’re doing accounts and you make an error you don’t delete it, you put another update against it stating that you made an error and this is where it’s fixed.