docs/core-workflows/checkpoints.mdx
Checkpoints let you undo code changes without losing your conversation. Every time Cline modifies a file or runs a command, it saves a snapshot of your project files. You can restore to any checkpoint, keeping the context you've built while reverting the code.
This changes how you work with Cline. Instead of carefully reviewing every change before approving, you can let Cline move fast and roll back if something goes wrong. The cost of a mistake drops to nearly zero.
<Tip> Checkpoints are enabled by default. See [Enable or Disable Checkpoints](#enable-or-disable-checkpoints) if you need to turn them off. </Tip>Cline maintains a shadow Git repository separate from your project's actual Git history. After each tool use (file edits, commands, etc.), Cline commits the current state of your files to this shadow repo. Your main Git repository stays untouched.
This means:
Each checkpoint captures the complete file state at that moment. If Cline edits three files in sequence, you get three checkpoints and can restore to any of them independently.
Checkpoints are enabled by default. To toggle them:
After each tool use, a checkpoint indicator appears in your conversation. Look for a bookmark icon labeled "Checkpoint" with a dotted line connecting to Compare and Restore buttons.
Click Compare to open a diff view showing exactly what changed at that checkpoint. This opens in your editor's diff viewer, letting you see additions, deletions, and modifications across all affected files.
This is useful when Cline makes changes you want to understand before deciding whether to keep them. You can review the diff, then either continue or restore to undo.
Click Restore next to any step to open the restore menu. You have three options:
| Option | What It Does | When to Use It |
|---|---|---|
| Restore Files | Reverts your project's files to the snapshot at this checkpoint | Undoing code changes while keeping the conversation |
| Restore Task Only | Deletes messages after this point, does not affect files | Trying a different prompt while keeping current code |
| Restore Files & Task | Reverts files and deletes messages after this point | Starting over completely from a known good state |
The right choice depends on what went wrong:
If the conversation is productive but the code changes broke something, use Restore Files. Cline keeps all the context you've discussed and can try a different implementation.
If Cline's code changes are good but the conversation went off track, use Restore Task Only. You keep the files and can guide the conversation differently.
If you want to start over from a clean slate, use Restore Files & Task. This resets both your files and the conversation to that checkpoint.
| Scenario | Recommended Action |
|---|---|
| Cline refactored code and broke something | Restore Files, ask for a different approach |
| Experimenting with multiple solutions | Compare each checkpoint, restore to the best one |
| Cline misunderstood your intent | Restore Files & Task, rephrase your request |
| Want to try a different prompt | Restore Task Only, keep the files, resubmit |
| Reviewing changes before committing to Git | Use Compare to inspect, then commit manually |
| Testing risky changes | Let Cline proceed, restore if it fails |
Checkpoints make auto-approve practical. Without checkpoints, auto-approve feels risky because Cline can make many changes before you notice a problem. With checkpoints, you can let Cline work autonomously and roll back if needed.
A typical workflow:
This approach is faster than reviewing every change individually, and checkpoints provide the safety net.
The message editing feature integrates with checkpoints. When you edit a previous message and select "Restore All," Cline restores your files to the checkpoint at that point before resubmitting your edited message.
This lets you fix a poorly worded prompt and undo all the changes that resulted from it in one action.