Make agent file edits reversible with checkpointing
configuration
// what it does
Enable checkpointing to have the CLI snapshot your project (via a shadow Git repo at ~/.gemini/history/<project_hash>) right before any tool modifies files. Run /restore alone to list checkpoints, or /restore <id> to roll files back and re-propose that tool call. Turn it on with --checkpointing or general.checkpointing.enabled in settings.json.
// shell
$ gemini --checkpointing$ /restore// gotcha
Checkpointing is off by default, so by the time you wish you had it, it is too late — enable it up front for risky refactors. It captures only AI-made file changes; your own manual edits and outputs of ! shell commands are not snapshotted.