What problem does it solve?
When an agent performs large refactors or uncertain multi-file edits, a single bad change can corrupt the working tree with no easy way back. This Skill turns git into an undo mechanism so risky work can be attempted boldly and reverted cleanly.
Core Features & Use Cases
- Checkpoint Commits: Saves the current good state with
git add -A && git commit before any risky or large-scale change, recording the commit hash for later return.
- Rollback Strategies: Discards uncommitted changes per-file with
git checkout -- <file>, resets everything with git reset --hard HEAD, or returns to a recorded checkpoint hash.
- Clean History Rules: Forbids
.bak backup files and requires squashing or resetting checkpoint commits before pushing the final PR branch.
- Use Case: Before refactoring a module across ten files, create a checkpoint commit; if the refactor breaks the build and cannot be quickly fixed, run
git reset --hard <checkpoint-hash> and try a different approach.
Quick Start
Ask the agent to create a git checkpoint before starting the refactor and roll back to it if the changes make things worse.