05 Errors & recovery · Restore and replay
After /restore, Gemini CLI runs the undone edit again without asking
Gemini CLI · CLI
The insight
If undo brings an action back, ask before running it again. A silent replay undoes the undo.
Documented
from the sourceVisible in the image: The Gemini CLI terminal right after /restore. The restored conversation shows the request to add "- Pick up stamps" to notes.md, and a finished ReadFile. Next comes the info line "Restored project to the state before the tool call." Directly under it: "Edit notes.md → Accepted (+1, -0)", with the diff line "6 + - Pick up stamps". No approval prompt sits between the restore and the edit. The footer shows the workspace, branch main, and the model. Observed on Gemini CLI 0.65.0, Oct 26, 2026.
- Before file-modifying tools run, Gemini CLI saves a Git snapshot in a shadow repository in your home directory.“It does not interfere with your own project's Git repository” — How it works
- /restore reverts your files, restores the conversation, and re-proposes the original tool call.“Re-propose the original tool call, allowing you to run it again, modify it, or simply ignore it.” — How it works
- Checkpointing is off by default and is enabled in settings.json.“The Checkpointing feature is disabled by default.” — Enabling the feature
Our read
design interpretationWhy it works
The rollback itself is clean. Files and conversation return to the moment before the edit. The shadow Git repo keeps recovery out of the user's own history.
Trade-off
The docs say the original tool call is re-proposed so you can run, change, or ignore it. In version 0.65.0 it ran again straight away, so the edit came back. To just undo an edit, use /rewind and choose "Revert code changes". That works without turning on checkpointing.
Steal this
- After undo, hand back the next decision, and don't replay the action for the person.
- Keep recovery data out of the user's own version history.
Source
Gemini CLI docs: Checkpointing
2026-10-26 · Accessed; checkpointing.md last changed 2026-04-10. Captured Oct 26, 2026 on Gemini CLI 0.65.0, Debian GNU/Linux 13 (trixie)
