{{command_prefix}}undo
Safe rollback for design-related commits. Uses git history plus file-overlap dependency checks before reverting.
Steps
- List candidates: Run
git log --oneline -n 20 --grep="design\|feat\|fix"via Bash. Filter for commits whose scope matches phase prefixes (design(,feat(07, etc.) or touch files undersrc/related to design changes. - Present choice: If no SHA was passed as argument, print the last 10 design-related commits and ask (AskUserQuestion): "Which commit to undo? (or enter commit SHA)"
- Dependency scan: For the chosen SHA, run
git show --name-only <sha>to get touched files. Then rungit log <sha>..HEAD --name-onlyto find later commits that modified any of those same files. These are potential dependencies. - Dependency decision:
- If none found: proceed to step 5.
- If found: print "Reverting this commit may break: . Proceed anyway? (yes/no)" and abort on "no".
- Stage the revert: Run
git revert <sha> --no-commit. Show the resulting diff viagit diff --cached. - Confirm: Ask (AskUserQuestion): "Apply this revert? (yes/no)"
- Commit or abort: On yes,
git commit -m "revert: <original subject>". On no,git resetto unstage.
Do Not
- Do not force-push.
- Do not revert commits on
mainwithout the user confirming branch context. - Do not silently skip dependency warnings.


