Chapter Nine · Git as the Undo Button
Git as the Undo Button
Every habit in this book assumes that any agent change can be thrown away in seconds, and this chapter is what makes that true. Five topics set a known-good commit before every request, keep each task on its own branch, give the three ways back, turn working commits into history a reviewer can follow, and run two agents at once without collisions.
Rejecting a diff, narrowing it to the hunks that were right, restarting from scratch with a sharper task: Chapters 5 to 8 recommended all three, and every one of them is only cheap if the way back is cheap. Git provides the way back, provided the work is committed in the right places and kept on the right branches. This chapter is that discipline, applied to work an agent produces quickly and in volume.
Git is assumed at the level of Git for Beginners: commit, branch, merge, revert. Nothing here re-teaches it. What is new is the rhythm: a commit before every request, a branch named for the task before the first request, working commits squashed before anyone else sees them, and a second directory when two tasks run at once. The deeper commands are covered in Git, GitHub & GitHub Actions.
The refund change finishes here: narrowed, tested and committed on its own branch, with messages that say why the window is 12 hours and why exactly 12 hours is refunded. The stray typo fix from the agent's diff leaves for a branch of its own, and a second agent replaces the deprecated date calls in schedule in a separate worktree while the first one works.