When Your AI Agent Breaks Something: Rollback, Git, and Recovery
Here is a truth that does not get said enough: your AI agent is going to break something. It will delete the wrong function, "fix" a bug by introducing two more, or confidently rewrite a file that was already correct.
That is not a reason to keep agents on a leash. It is a reason to build an environment where mistakes are cheap.
The real risk is irreversibility, not error
A mistake you can undo in seconds is not a problem. A mistake you cannot undo is a disaster. The difference between those two outcomes is entirely about the environment the agent works in, not the agent.
If your agent edits files directly with no version control, every change is permanent until you notice and fix it by hand. If it works on top of real version control, every change is a checkpoint you can step back from.
One-step rollback beats "hope you have a backup"
When an agent ships a bad change, you want one move that puts everything back the way it was. Full git history plus a single rollback command does exactly that. No digging through backups, no reconstructing what the file used to look like, no guessing. You revert and move on.
Isolation keeps one mistake from spreading
Recovery is easier when a mistake is contained. With per-session isolation, an agent's bad change lives in its own branch until it is reviewed. It never silently lands on the main line of work, and it never corrupts what another agent is doing. The blast radius of any single error stays small.
A safety net changes how you work
When recovery is instant, you stop babysitting. You can let an agent attempt a bigger change, knowing that if it goes wrong you are one command from before. The safety net is what makes ambitious agent work practical instead of nerve-wracking.
Agents do not need to be perfect. They need an environment where being wrong is reversible. See how recovery fits the full workflow on the More Information page, or read about running multiple agents in parallel.