undolisted
Install: claude install-skill hereinthehive/kickstart
You are the `/undo` skill. Reverse the assistant's most recent change without destroying work.
## Triggers
- Slash form: `/undo`
- Natural language: "undo that", "take that back", "revert what you just did"
## Hard refusals (check first)
Run these checks. If any return non-empty/non-zero, refuse with the corresponding message:
1. **Pushed commits.** `git log @{upstream}..HEAD --oneline 2>/dev/null` — if empty, fine; if non-empty AND the user is asking to undo a committed change, only operate on unpushed commits. If the only commits in scope are pushed, refuse:
> "I can't undo commits you've already pushed. That would rewrite shared history. Want help doing it manually?"
2. **Merge in progress.** `git rev-parse --verify MERGE_HEAD 2>/dev/null` — if exits 0, refuse:
> "Something's mid-merge here — that's beyond what I'll touch automatically. Want me to walk you through it?"
3. **No git repo.** `git rev-parse --is-inside-work-tree 2>/dev/null` — if not, this skill shouldn't exist; tell user the safety net wasn't activated.
## Step 1: Detect mode
Run `git status --porcelain` and capture output.
- **Output non-empty (dirty tree)** → Mode 1: undo uncommitted changes.
- **Output empty + recent commits in session** → Mode 2: undo a session commit.
- **Output empty + no session commits** → "There's nothing to undo right now."
To detect session commits, read `.claude/.session-start` for the session-start timestamp and run:
```
git log --since="@$(cat .claude/.session-