All the callbacks that are fired after tree is modified in some way offer you a rollback object that you can use with the rollback function.