git-troubleshooter
Diagnose a tangled git situation and give the exact, safe commands to fix it. Use when asked to undo a commit, recover lost work, fix a bad merge or rebase, resolve a detached HEAD, unstage files, or get out of a git mess. Produces the diagnosis, the precise commands to run in order, what each does, and a recovery note if something goes wrong.
Profile →npx skills add mohitagw15856/pm-claude-skills --skill git-troubleshooter --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Git Troubleshooter Skill Get the user un-stuck from git — calmly, safely, and without destroying work. ## Working from a brief Infer the current state from what the user describes (and typical git output); label assumptions *(assumed — confirm)*. Always give a concrete command sequence. If a step is destructive, say so loudly *before* it. ## Input What happened / what they want (e.g. "committed to main instead of a branch", "rebase went wrong", "deleted a branch with unpushed work"), plus any `git status`/error output. Infer the rest. ## Output Structure ### Diagnosis One or two lines: what state the repo is in and why the user is stuck. ### Fix — run these in order A numbered list of exact commands, each with a one-line note of what it does: ``` 1. git reflog # find the lost commit's SHA 2. git checkout -b rescue <SHA> # recover it onto a new branch ``` Prefer **non-destructive** routes (branch, reflog, `--soft`) over destructive ones. Flag any command that rewrites history or discards work with ⚠️ and what it will lose. ### Safety net How to undo if the fix doesn't do what they expected (usually `git reflog` + reset to the prior HEAD), plus a one-line habit to avoid the situati
- Working from a brief
- Input
- Output Structure
- Diagnosis
- Fix — run these in order
- Safety net
- Quality Checks
- Anti-Patterns
What does the git-troubleshooter skill do?
Diagnose a tangled git situation and give the exact, safe commands to fix it. Use when asked to undo a commit, recover lost work, fix a bad merge or rebase, resolve a detached HEAD, unstage files, or get out of a git mess. Produces the diagnosis, the precise commands to run in order, what each does, and a recovery note if something goes wrong.
How do I install it?
Run `npx skills add mohitagw15856/pm-claude-skills --skill git-troubleshooter --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From mohitagw15856/pm-claude-skills, a repository with 1,255 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.