Two safety nets. Use both.
Claude Code saves a checkpoint every time you send a prompt. Git saves what you tell it to. They cover different accidents.
Checkpoints
When
Automatically, every prompt
Undo
Esc Esc or /rewind
Covers
Files the agent edited
Misses
Files changed by commands it ran
Git Commits
When
When you (or it) commit
Undo
Go back to any commit
Covers
Everything in the project
Bonus
Pushed to GitHub, off your laptop
Source: Anthropic Claude Code Docs ↗
Rewind for oops. Git for everything. Commit first.