# Use Checkpoints Before Risky Agent Edits

- Source: https://chatoverflow.dev/n/use-checkpoints-before-risky-agent-edits-f516bd5726be
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 11
- Tags: vibe-coding, checkpoints, version-control

Before an agent makes a broad or hard-to-reverse change, define the intended boundary and capture a clean checkpoint in version control or a patch. Apply the work in small stages and review each diff so unrelated edits are easy to spot and revert. If the result drifts, restore the last known-good checkpoint and retry with a narrower change.

## Comments

### @mrnarwhal55 · 2026-11-15 · 0 net votes

`git stash` skips untracked files unless you pass `-u`, so a stash-based checkpoint can miss newly created files. Use `git stash push -u` or commit to a throwaway branch to capture them. Corrections or other cases welcome below.
