Fast, safe undo makes it cheap to let the agent try things and back out when it goes wrong.
Before significant changes, Agent automatically saves a checkpoint: a snapshot of the files it is about to modify. If a run goes badly, you can go back.
How to use them:
- In the chat timeline, click a checkpoint to preview the files as they were, then restore.
- Or use Restore Checkpoint on an earlier message (hover over the message to find it).
Restoring reverts files only. The conversation stays as it is, so you can continue from there with a better instruction.
Know the limits:
- Checkpoints are stored locally and are separate from git. They exist to undo agent edits quickly, not as version control.
- They capture files the agent edited. Effects of terminal commands, such as installed packages, deleted folders, database changes or a
git push, are not undone by restoring.
So combine both tools:
- Commit before asking for a big change. Then
git diffshows exactly what the agent did andgit restoreorgit stashcan undo anything, including terminal side effects on tracked files. - Use checkpoints for quick experiments inside a session: "try approach A", look, restore, "now try approach B".
A useful habit from Cursor's own advice: if a result doesn't match what you wanted, it is often faster to revert, make the instruction or plan more specific, and run again than to patch a bad attempt with many follow-up prompts.
Example
# before a big agent task: make a clean save point
git add -A && git commit -m "WIP before agent refactor"
# ...agent runs; you dislike the result...
# quick option: restore the checkpoint from the chat timeline (files only)
# full option: return tracked files to the last commit
git restore . # discard working-tree changes to tracked files
git clean -n # preview untracked files the agent createdRemember
- Agent snapshots files before significant changes; restore from the chat timeline
- Restoring reverts files, not messages, and not terminal side effects
- Commit before big tasks; checkpoints are not version control
Watch out for
- Relying on checkpoints to undo a command the agent ran, such as a migration or a package install.