A rollback undoes changes to your data. But "rollback" means two very different things depending on whether your change is still open or already committed — and mixing them up is where people get burned.
In SQL, work happens inside a transaction. Your changes stay provisional — visible only to your session — until you decide their fate:
BEGIN;
UPDATE accounts SET balance = balance - 100 WHERE id = 1;
UPDATE accounts SET balance = balance + 100 WHERE id = 2;
-- both succeed → keep them:
COMMIT;
-- something's wrong → throw them away:
ROLLBACK;
SAVEPOINT), then ends it.This is the ACID safety net: an all-or-nothing unit of work. If your session crashes mid-transaction, the database automatically rolls the uncommitted work back on recovery.
Here's what trips people up. ROLLBACK only works before COMMIT. The moment you commit, the change is permanent and ROLLBACK can do nothing about it. Run a bad UPDATE without a WHERE, commit it, and transaction control won't save you.
To reverse a change you've already committed, you need something else entirely:
| Mechanism | What it does |
|---|---|
| Oracle Flashback | Time-travel to data as it was, using undo/flashback logs — Oracle-specific. |
| Point-in-time recovery | Restore the database to a past moment from backups + logs. Heavy, all-or-nothing. |
| Restore from backup | Roll the whole database back to a snapshot. Loses everything after it. |
| Version history | Keep a git-style record of changes and revert a specific one, like reverting a commit. |
Most people who search for "how do I roll back" have already committed. What they actually want isn't transaction control — it's a history they can step back through. That's a different model: instead of a pre-commit safety net that vanishes the instant you commit, you keep versions of your data over time and revert to an earlier one whenever you need to.
This is exactly how data version control works, and it's what Varan gives you — a git-style history across PostgreSQL, MySQL, DuckDB and files, so you can undo an already-applied change without a DBA restore or a vendor-specific flashback feature.
ROLLBACK discards an open, uncommitted transaction. Flashback / recovery reverses committed changes, but is engine-specific and often DBA-grade. Git-style history reverses committed changes with a simple, vendor-agnostic model — and works across databases and files at once.
Varan keeps a version history across your sources — revert a change like reverting a commit. Free during the beta.
Request beta access →Not with ROLLBACK — a commit is permanent. You need flashback, point-in-time recovery, or a version history to undo committed changes.
ROLLBACK discards an uncommitted transaction; Flashback reverses already-committed changes. See the full version-control comparison.
Varan's history spans PostgreSQL, MySQL, DuckDB and files together — see cross-source SQL.