Pre-submission checklist
Feature name
Safe git revert command (/gsd-undo)
Type of addition
New command (slash command or CLI flag)
The solo developer problem
When a GSD phase or plan produces bad output -- broken code, wrong approach, or corrupted state -- there is no GSD-native way to safely roll back the git commits made during that phase. The developer must manually identify which commits belong to the phase, figure out dependency ordering, and run git revert commands. This is error-prone, especially when a phase touched many files across multiple commits. A solo developer without a reviewer is likely to miss commits or revert in the wrong order.
What this feature adds
A new /gsd-undo command that safely reverts GSD phase or plan commits using git revert --no-commit (never git reset -- history is always preserved).
Three modes:
--last N: Show the last N GSD commits (filtered by conventional commit pattern) for interactive selection. The developer picks which commits to revert.
--phase NN: Revert all commits for a specific phase. Reads the phase manifest (.planning/.phase-manifest.json) first; falls back to git log filtering by phase number in commit scope.
--plan NN-MM: Revert all commits for a specific plan within a phase.
Safety features:
- Dependency check: Before reverting, checks if later phases depend on the target phase's output. If so, warns the developer and requires confirmation.
- Confirmation gate: Displays the exact commits that will be reverted and asks for confirmation before executing.
- Atomic revert: All reverts are staged together in a single commit, not applied one at a time.
Example usage:
/gsd-undo --phase 03
> Found 4 commits for Phase 03 via phase manifest.
> WARNING: Phase 04 depends on Phase 03 output. Reverting may break Phase 04.
> Commits to revert:
> abc1234 feat(03-01): implement auth endpoint
> def5678 feat(03-02): add auth middleware
> ghi9012 test(03): add auth tests
> jkl3456 docs(03): complete phase summary
> Proceed? [y/N]
Full scope of changes
Files created:
commands/gsd/undo.md -- slash command definition with --last/--phase/--plan flags
get-shit-done/workflows/undo.md -- revert workflow with manifest lookup, dependency check, confirmation gate
Files modified:
- None required. The command and workflow are self-contained.
User stories
- As a solo developer who just completed a phase that produced broken code, I want to run
/gsd-undo --phase 03 to safely revert all commits from that phase, so I can re-plan and re-execute without manually identifying and reverting individual commits.
- As a solo developer who made a mistake in one specific plan, I want to run
/gsd-undo --plan 03-02 to revert only that plan's commits while keeping the rest of the phase intact.
Acceptance criteria
Which area does this primarily affect?
Core workflow (init, plan, build, verify)
Applicable runtimes
Breaking changes assessment
None. This is an entirely new command. No existing behavior is modified.
Maintenance burden
Low-medium. The phase manifest dependency (.planning/.phase-manifest.json) means the command works best when the manifest is maintained. The git log fallback ensures it works even without a manifest but with lower accuracy. The dependency check logic needs to stay in sync with how phases express dependencies in ROADMAP.md.
Alternatives considered
- Manual git revert -- Error-prone for multi-commit phases. The developer must identify which commits belong to which phase.
- Planning state rollback only (no git revert) -- Does not address the actual code changes. Rolling back
.planning/ state without reverting the code leaves the project in an inconsistent state.
- git reset --hard -- Destructive and loses history. GSD must preserve history for auditability.
Prior art and references
Replaces #1719 (which incorrectly described this as a planning state rollback). Split from #1686 per maintainer feedback. Uses git revert --no-commit pattern from Git documentation.
Pre-submission checklist
approved-featurebefore writing any codeFeature name
Safe git revert command (/gsd-undo)
Type of addition
New command (slash command or CLI flag)
The solo developer problem
When a GSD phase or plan produces bad output -- broken code, wrong approach, or corrupted state -- there is no GSD-native way to safely roll back the git commits made during that phase. The developer must manually identify which commits belong to the phase, figure out dependency ordering, and run git revert commands. This is error-prone, especially when a phase touched many files across multiple commits. A solo developer without a reviewer is likely to miss commits or revert in the wrong order.
What this feature adds
A new
/gsd-undocommand that safely reverts GSD phase or plan commits usinggit revert --no-commit(nevergit reset-- history is always preserved).Three modes:
--last N: Show the last N GSD commits (filtered by conventional commit pattern) for interactive selection. The developer picks which commits to revert.--phase NN: Revert all commits for a specific phase. Reads the phase manifest (.planning/.phase-manifest.json) first; falls back to git log filtering by phase number in commit scope.--plan NN-MM: Revert all commits for a specific plan within a phase.Safety features:
Example usage:
Full scope of changes
Files created:
commands/gsd/undo.md-- slash command definition with --last/--phase/--plan flagsget-shit-done/workflows/undo.md-- revert workflow with manifest lookup, dependency check, confirmation gateFiles modified:
User stories
/gsd-undo --phase 03to safely revert all commits from that phase, so I can re-plan and re-execute without manually identifying and reverting individual commits./gsd-undo --plan 03-02to revert only that plan's commits while keeping the rest of the phase intact.Acceptance criteria
/gsd-undo --last 5shows the last 5 GSD conventional commits and allows interactive selection/gsd-undo --phase NNreads phase manifest first, falls back to git log filtering/gsd-undo --plan NN-MMreverts only commits matching the specific plangit revert --no-commit(nevergit reset)/gsd-helpWhich area does this primarily affect?
Core workflow (init, plan, build, verify)
Applicable runtimes
Breaking changes assessment
None. This is an entirely new command. No existing behavior is modified.
Maintenance burden
Low-medium. The phase manifest dependency (
.planning/.phase-manifest.json) means the command works best when the manifest is maintained. The git log fallback ensures it works even without a manifest but with lower accuracy. The dependency check logic needs to stay in sync with how phases express dependencies in ROADMAP.md.Alternatives considered
.planning/state without reverting the code leaves the project in an inconsistent state.Prior art and references
Replaces #1719 (which incorrectly described this as a planning state rollback). Split from #1686 per maintainer feedback. Uses
git revert --no-commitpattern from Git documentation.