Skip to content
English
Level 6: Trust & Safety
Lesson 8 · +10 XP

Git is your undo

Approve an action you shouldn’t have? It happens to everyone. The interesting part isn’t the mistake — it’s whether you have a safety net under it.

For file edits, that net is almost always git.

The real source of confidence to work fast with Claude isn’t avoiding mistakes. It’s having a one-command undo.

You’ll go deep on git in Level 8. This lesson is the bare minimum that lets you breathe when Claude touches the wrong file.

The two commands that save you

git status — shows you what Claude changed. Before approving anything that runs across multiple files, run it once so you have a “before” snapshot in your head. After Claude is done, run it again and you’ll see exactly which files moved.

git status

It’ll list things as modified, deleted, new, or staged. That’s your map of the damage (or the progress — sometimes it’s progress).

git checkout <file> — undoes changes to a specific file, returning it to the last committed version.

git checkout src/login.tsx

That single command rolls one file back to exactly the state it was in at your last commit. The change Claude made is gone.

The workflow this enables

Three lines of git turn into a real working pattern:

  1. Commit before you start. Even a half-done commit is fine — git commit -am "wip" if you have to. That commit is your bookmark.
  2. Let Claude work. Edit-heavy mode, fast iteration, no hand-wringing over each prompt.
  3. git status and check. If something’s wrong: git checkout the bad files, leave the good ones, move on.

This is why “accept edits” mode from the last lesson is so much less scary than it sounds. The edits are fully reversible as long as the previous state is in git. Claude is moving fast across your files, but the floor is solid.

What git does not save

Git protects code that’s already committed. It does not protect:

  • Files you’ve never committed (.env, secrets, untracked notes).
  • Things outside the repo — your home directory, your shell config, your databases.
  • Anything that left your machine — a push, an API call, a sent message.

That’s a fancy way of saying: git is the undo for two-way doors. The one-way doors from Lesson 6.4 still need to be read carefully before approving. No safety net is going to bring back a sent email.

The deep version is coming

Level 8 covers committing the Claude way, writing useful commit messages, working with PRs, and handling review feedback. For now, the two commands above are enough to give you the confidence to move fast in the level after this one.

What’s next

You can read a prompt, judge its blast, recognize a one-way door, pick a mode, allowlist the boring stuff, trust a project deliberately, and recover from a mistake. The last lesson of the level is the habit that ties all of it together — a short checklist for the prompts that aren’t obviously safe or obviously scary.