Rollback migration script

I know this is not a database but it would be really useful to have a rollback section/script, within each migration script file, in case the user wants to rollback/revert what that script did.

Currently, it is not as easy to test migration scripts without having to recreate environments or manually revert their changes…

Perhaps if transactions were possible, this might have been a lesser wanted feature but without transactions, if I have a script that fails half-way, I can’t rollback easily or fix and retry…