Every job in the warm-up folder ends in its own commit, so the last commit is a checkpoint you can go back to. In this video, you saw an example of a job going wrong and how to undo it, in part or in whole, and what no undo can bring back.
Key Points
- Undoing a job means going back to your last checkpoint. Start each job from a clean working tree, as in the last lesson, so everything that changed afterward is the job’s doing.
git restoreputs back a file Git already tracks, as it was in the last commit, as long as you haven’t rungit addon it since. If you have, it puts back the version you added. It prints nothing.- Restore doesn’t touch new files. A file the job created was never in a commit, so
git statusstill lists it underUntracked files. - Git can’t bring back the edits you throw away. They were never committed, so Git has no copy of what
git restorediscards. Your editor or your agent might keep one, but don’t count on it. git clean -nlists the new files, andgit clean -fremoves them. Read the list first:-fremoves every file on it, including one of yours that you haven’t committed yet. It skips new folders.- Undo some files to keep part of a job, or every file to drop all of it. Review and commit the part you keep, so it becomes the next checkpoint. After undoing a whole job,
git statussaysworking tree clean. - An agent’s own undo is narrower than it looks. It usually puts back only the files the agent edited itself, not files that only its commands changed, such as code a formatter rewrote.
- Nothing in Git or the agent brings back what happened outside the folder’s files, such as a file deleted in another folder, a reset database or a sent message. Your permissions decide which commands run without asking.
The Undo, Step by Step
The job in the video is an example, not a recorded session. Asked to make check-words.js also print the words that pass, the agent did that, then removed the three words that break a rule from words.txt and moved them into a new file, failed-words.txt. Even with your instruction file, an agent can slip like this. Here’s what git status showed afterward: