← ClaudeAtlas

undolisted

Safely undo the most recent git commit(s) on a feature branch. TRIGGER when the user says "undo my last commit", "undo last N commits", "oops revert that commit", "undo the commit but keep my changes", "uncommit", "revert my last change", "take back that commit", "/nyann:undo". Trigger on "revert" only when the user clearly means undoing a local commit (not `git revert` on a published one — see DISAMBIGUATION). DISAMBIGUATION: if the user says "revert a commit that's already on main" / "revert a pushed commit" / mentions a specific remote SHA, this is the `git revert` workflow — undo-skill refuses pushed commits by default. Explain the difference and either use --allow-pushed (risky) or direct them to `git revert <sha>`. Do NOT trigger on "undo the last edit" (that's editor-level) or "rollback the deploy" (that's infrastructure, out of scope). Do NOT trigger on main/master/develop — long-lived branches should never be history-rewritten; use `git revert` instead.
thettwe/nyann · ★ 6 · Code & Development · score 71
Install: claude install-skill thettwe/nyann
# undo Wraps `bin/undo.sh`. History-mutating operation — treat as destructive. ## 1. Always preview first Before any mutation, run `bin/undo.sh --dry-run` and show the user which commits will be undone. The preview JSON lists them newest- first with SHA and subject. Read it back and ask the user to confirm — even for a single-commit undo. Exception: the user's request explicitly included "don't ask" / "just do it" AND `--count` is 1 AND `--strategy` is `soft` (the safest default). For anything multi-commit or non-soft, always confirm. ## 2. Decide strategy Default is `soft` (safest — all changes stay staged). When the user's intent is unclear, **you MUST call the `AskUserQuestion` tool** (not plain text): ```json { "questions": [ { "question": "How should the commit be undone?", "header": "Strategy", "multiSelect": false, "options": [ { "label": "Soft (Recommended)", "description": "Undo commit, keep changes staged" }, { "label": "Mixed", "description": "Undo commit, keep changes in working tree (unstaged)" }, { "label": "Hard", "description": "Undo commit AND discard all changes permanently" } ] } ] } ``` For `hard`, warn the user twice: the work is gone after hard reset. Confirm before executing even after the picker selection. ## 3. Decide scope - **`last-commit`** (default) — one commit. - **`last-N-commits` with `--count <N>`** — multiple commits. Use when the user says "undo the last 3 commits