> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/cline/cline/llms.txt
> Use this file to discover all available pages before exploring further.

# Checkpoints

> Automatically saved snapshots let you roll back code changes while keeping your conversation. Experiment freely and restore any previous state.

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 while keeping all the context you've built up in chat.

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>

## How checkpoints work

Cline maintains a shadow Git repository that is completely separate from your project's own Git history. After each tool use — file edits, commands, and so on — Cline commits the current state of your files to this shadow repo. Your main Git repository stays untouched.

This means:

* Your Git history remains clean and under your control
* Checkpoints capture all files, including ones not tracked by Git
* You can restore to any point in a task without affecting commits you've already made
* Checkpoints persist across editor sessions

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.

## Enable or disable checkpoints

<Steps>
  <Step title="Open Cline settings">
    Click the gear icon in the Cline sidebar.
  </Step>

  <Step title="Find Feature settings">
    Scroll to the **Feature Settings** section.
  </Step>

  <Step title="Toggle checkpoints">
    Toggle **Enable Checkpoints** on or off.
  </Step>
</Steps>

<Note>
  For very large repositories, checkpoints may use significant storage and slow down Cline slightly as it commits file snapshots after each tool use. Consider disabling them if you notice performance issues.
</Note>

## Viewing and comparing changes

After each tool use, a checkpoint indicator appears in your conversation — a bookmark icon labeled **Checkpoint** with **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. Review the diff, then either continue or restore.

## Restoring checkpoints

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 files to the snapshot at this checkpoint        | Code changes broke something but the conversation is still productive |
| **Restore Task Only**    | Deletes conversation messages after this point, does not touch files | Code changes are good but the conversation went off-track             |
| **Restore Files & Task** | Reverts files and deletes messages after this point                  | Starting over completely from a known-good state                      |

### Choosing the right restore option

<AccordionGroup>
  <Accordion title="The code broke but the conversation is useful">
    Use **Restore Files**. Cline keeps all the context from your conversation and can try a different implementation approach without you needing to re-explain the goal.
  </Accordion>

  <Accordion title="The code is good but the conversation went off-track">
    Use **Restore Task Only**. Your file changes are preserved and you can guide the conversation in a different direction from that point.
  </Accordion>

  <Accordion title="Everything went wrong — start over">
    Use **Restore Files & Task**. This resets both files and the conversation to the checkpoint, giving you a clean slate from a known-good state.
  </Accordion>
</AccordionGroup>

## When to use checkpoints

| 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      |
| You 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 and auto-approve

Checkpoints make [auto-approve](/features/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.

<Steps>
  <Step title="Enable auto-approve">
    Turn on auto-approve for file edits and commands in Cline settings.
  </Step>

  <Step title="Let Cline work">
    Cline moves through the task quickly without waiting for approval at each step.
  </Step>

  <Step title="Review the final result">
    Inspect the outcome once Cline finishes. Use **Compare** on any checkpoint to review what changed.
  </Step>

  <Step title="Restore if needed">
    If something went wrong, restore to the last good checkpoint and give Cline more specific guidance.
  </Step>
</Steps>

## Checkpoints and message editing

Checkpoints integrate with message editing. 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 automatically undo all the file changes that resulted from it — in a single action.
