Skip to content

Day 5 of 52 · about 10 min · Basics

Undo Claude’s edits with checkpoints

Sooner or later you approve an edit you regret. Knowing you can take it back in seconds makes every later prompt less risky.

You’ll finish with

  • An edit undone with /rewind
  • A clear line between what rewind restores and what needs git

You’ll need

  • Claude Code set up as on Day 1
  • The practice project or any project, plus git

Before you start

Tell us about your setup and the steps change to fit it. Your answers stay in this browser, and you can change them at any time.

Which system are you on?

Commands differ between systems. Pick the one you’ll run Claude Code on.

The steps

One step at a time. When a step’s check matches, tick it and the next one opens.

0 of 3 steps done0%
  1. Step 1 of 3: Make an edit you’ll undo

    Ask Claude for a change you don’t want to keep.
    In Claude Code

    You type: Rewrite README.md so it's half as long.

    What happens: Claude rewrites the file with its file editing tools. Approve the edit if asked.

    Each prompt that starts a turn saves a checkpoint of your code first.

    Check it worked

    Open README.md: it’s much shorter than before.

  2. Step 2 of 3: Rewind the edit

    Open the rewind menu, pick your prompt and restore the code.

    Type /rewind, or press Esc twice with an empty prompt. Select the prompt that asked for the rewrite, then choose Restore code.

    Restore code

    • Files go back
    • The conversation stays

    Restore conversation

    • The chat goes back
    • Files stay as they are

    Restore code and conversation

    • Both go back
    The code options appear only when that point has file edits to undo.

    Check it worked

    README.md is back to its full length, and the conversation is still there.

  3. Step 3 of 3: Know what rewind can’t undo

    Shell commands aren’t tracked, so keep a safe point in git too.

    Rewind restores

    • Edits Claude makes with its file tools

    Only git restores

    • Files changed by shell commands such as rm or mv
    • Your own edits outside Claude Code
    • Most subagent edits
    Checkpoints are a quick undo inside a session, not version control.

    Commit a safe point. Skip git init if the project is already in git:

    Terminal or PowerShell
    git init
    git add .
    git commit -m "Start Acme Quotes"

    Check it worked

    git log --oneline shows your commit.

    If it didn’t work

    Git says “Author identity unknown”

    Run the two git config commands its message shows, with your name and email, then commit again.

Finish · 3 of 3 steps to go

You can take back an edit in seconds

Rewind for quick undo inside a session. Commit with git before big tasks, because only git sees every change.

What you’ll have checked

  • /rewind brought README.md back
  • git log --oneline shows a safe point

Lesson updates by email

Get lesson updates by email

Leave your email and we’ll tell you when we add or update a lesson.

We’ll email you when we add or update a lesson. We use your email only for this. Privacy policy

Claude Code for your team

Want Claude Code set up across your team?

HorizonLux sets up and repairs Claude Code for teams: CLAUDE.md rules, hooks that enforce them and reviewed MCP servers. Book a free call to talk it through.

Questions

Questions about Day 5

Can I rewind after closing Claude Code?

Yes. Checkpoints are saved with the conversation, so `/rewind` works after you resume a session, until the snapshots are cleaned up, about 30 days later by default.

Sources

Checked against the official Claude Code docs on .

Independent resource, not affiliated with Anthropic. HorizonLux wrote this lesson; Claude Code is made by Anthropic.