How to review, undo and commit Claude Code changes

Day 6, 30 minutes · beginner

Goal of this lessonRead every change since your first commit, undo a change with /rewind, ask Claude Code for a check with evidence and make a commit you reviewed yourself.

Why it matters

Claude Code can write a lot in a short time. Some of it will be exactly right, some almost right, and now and then something you did not ask for. The work is only yours once you have read it. This lesson is about that last part of every task: reading what changed, undoing what you do not want, and saving the rest as a clear step in your project's history.

You learn three safety nets that work together. The diff shows every line that changed. Checkpoints let you undo Claude's edits inside a session. Git commits keep your saved versions for good, with a message that says what changed and why.

At the end Tilda's site has a second commit that holds the work of lessons 2 to 5, made by Claude after you read every change, ran a check and named the files yourself.

Read the diff

A diff is the list of differences between two versions of a file: lines added, lines removed. It is the fastest way to see what Claude really did, instead of what it says it did.

Claude Code has a built-in view for it. /diff lists changed files, with the number of lines added and removed, and opens each file's changes. It can also show the edits of one prompt at a time. Depending on how your terminal shows Claude Code, it opens as a panel next to the conversation or as a box above the prompt. Git gives the full picture since your last commit: git status (which files changed or are new) and git diff (which lines changed in files git already tracks). Inside Claude Code you can run those with a ! in front, which runs the command in your shell (the terminal's own command line) without Claude.

Read the diff with your request next to it. Did it change only what you asked? Is anything there you did not expect?

Undo with checkpoints

Claude Code saves a checkpoint, a restore point for the files Claude edits, every time you send a prompt. The checkpointing page explains the rewind menu. Open it with /rewind (or its short name /undo), or press Esc twice when the prompt is empty. Pick the message you want to go back to and choose what to restore:

  • Restore code and conversation: back to before that message, files and chat both.
  • Restore conversation: the chat goes back, your files stay as they are.
  • Restore code: the files go back, the chat stays.

Checkpoints have limits, and they matter:

  • They only cover files Claude changed with its own editing tools. A file changed only by a shell command is not restored.
  • They are not a version history: the docs call them a quick recovery inside a session and point to git for commits and lasting history.
  • If you edited a file yourself after the checkpoint, restoring can throw your own edit away.

The docs call checkpoints a quick undo inside a session, not a replacement for git. So practise the undo before you commit, while the change is still only in your files.

Ask for a check, with evidence

Claude stops when the work looks done. The best practices page says to give it something it can check, and to ask for evidence: the command it ran and its output, or the exact lines. "All good" tells you little. A list of points with the line that proves each one takes you a minute to verify.

For Tilda's page the check is simple: the rules from CLAUDE.md and the requests from earlier lessons. On a bigger project it would be a test command.

Commit with care

You can ask Claude Code to commit in plain words. The quickstart's example is "commit my changes with a descriptive message". Two habits make that safer:

  • Name the files. Then nothing slips in by accident, such as a private file. A file that must never be committed goes in .gitignore, git's list of files to leave out.
  • Read the commit command before you approve it, including the message. A good message says what changed and why, in a line someone else understands.

After the commit, review it yourself. git log --oneline lists your commits, one per line. git show --stat HEAD shows the last commit's message and its files. If something is wrong, ask Claude to fix it in a new commit rather than rewriting the old one.

You may see a line at the end of the message that credits Claude. Claude Code adds that kind of attribution by default; a setting called attribution changes it.

The steps

  1. Read every change since your first commit, in Claude Code and in git.
  2. Practise an undo on a change you do not want, with the rewind menu.
  3. Ask for a check with evidence, and read it.
  4. Commit the named files with a clear message, after reading the command.
  5. Review the commit yourself.

Follow the steps for Claude Code below.

Example: Tilda's second commit

Tilda's git status showed index.html as changed, and CLAUDE.md, the new .claude folder and secret-recipe.txt as new. The recipe must stay out.

She asked for bright pink headings, approved it, and saw the pink in the diff. Two presses of Esc opened the rewind menu. She picked the pink message, chose Restore code and conversation, and the pink was gone.

Claude's check listed five points, each with a line from the page. Four held. The fifth did not: the intro sentence still said "Open Tuesday to Saturday", so Sunday was missing there. She asked Claude to fix that line and checked the diff again.

Then she asked for the commit with the file list. The prompt showed secret-recipe.txt in .gitignore and four files in the commit, with the message "Add opening hours on Sunday, Bread of the day, footer and project rules". git log --oneline showed two commits. Her history now tells the story of the site.

Common mistakes

  • Committing everything with one vague message. Name the files, and say what and why.
  • Treating rewind as your version history. Checkpoints are for quick recovery inside a session. Commits keep your history.
  • Accepting "the check passed" without the evidence.

Today's actions

Ticks are not saved without an account

Do it in Claude Code

Claude Code

  1. Start Claude Code in your practice folder in Manual mode, then type /diff. It lists changed files with lines added and removed. In the box above the prompt, pick a file with the arrow keys and Enter, and go back with Esc. In a side panel, click a file.
    cd marlow-bakehouse
    claude --permission-mode manual
  2. See the full picture in git. A line that starts with ! runs in your shell (the terminal's own command line) directly. git status lists changed and new files. Then run ! git diff to see each changed line, + for added and - for removed.
    ! git status
  3. Practise an undo. Ask for a change you do not want, and approve it.
    Make all headings on the page bright pink.
  4. With an empty prompt, press Esc twice (or type /rewind). Select your pink headings message and choose Restore code and conversation. That message comes back in the input box: press Esc twice to clear it. Check with /diff that the pink is gone.
  5. Ask Claude for a check, with evidence you can read.
    Check index.html against CLAUDE.md and my requests so far: opening hours in one place, Sunday included, the Bread of the day list complete, prices with a comma, every tag closed. For each point, show me the line that proves it. Do not change anything.
  6. Ask for a commit that names the files. Read the command in the prompt, including the message, before you choose Yes.
    Add secret-recipe.txt to .gitignore. Then commit index.html, CLAUDE.md, .gitignore and, if it exists, .claude/settings.json, with a short message that says what changed and why. Show me the list of files first. Do not commit secret-recipe.txt.
  7. Review the commit yourself: ! git log --oneline -5 shows your commits, and ! git show --stat HEAD shows the message and the files in the last one.
  8. If something is wrong in the commit, tell Claude what to fix and let it make a new commit for the fix. Then type /exit.

Note: The rewind menu only restores files that Claude changed with its own editing tools. It does not restore a file that only a shell command changed; use git for that. Your commit message may end with a line that credits Claude: Claude Code asks for it by default, and its attribution setting changes that.

Paid planNeeds a paid Claude plan (Pro, Max, Ultra, Team or Enterprise) or a Claude Console account. The free Claude plan does not include Claude Code.

Checked on 4 December 2026 · Source: Claude Code docs: Checkpointing (opens in a new tab)

Create a free account to save your progress. Sign in or sign up