git-recovery
Skill1 starsChanged 3 months agoMITView on GitHub
Conductor-only. This project's rules for emergency and advanced git — undoing commits, recovering lost work, stash, cherry-pick, bisect, history rewrites, deleting branches — and the procedure for resolving merge, rebase and cherry-pick conflicts. Trigger on "stash", "cherry-pick", "bisect", "git blame", "lost commit", "undo commit", "recover", "clean up branch", "drop commit", "reflog", "merge conflict", "rebase conflict", "CONFLICT (content)", "<<<<<<", "resolve conflict", "git merge failed", "git rebase failed".
- Deletes or force-pushes
- Commits and pushes
3 other projects use a version of this.
Adopted by
Most recently taken up by
- gabrielbauman/skillstheir own version, first seen Jul 16, 2026
- pvnarp/agent-skillstheir own version, first seen Mar 13, 2026
- DaleSeo/git-skillstheir own version, first seen Jan 26, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- DaleSeo/git-skills★ 1same name
- gabrielbauman/skills★ 1same name
- pvnarp/agent-skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository18 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- adversarial-reviewSkill
- clean-architectureSkill
- decision-recordingSkill
- design-system-checkSkill
- feature-branchingSkill
- finding-dispositionSkill
- gotcha-recordingSkill
- human-checkpointSkill
- plan-reviewSkill
- plan-writingSkill
- pr-createSkill
- spec-writingSkill
- tdd-loopSkill
- update-toolkitSkill
- wiki-updateSkill
- worker-dispatchSkill
The file
Files
Git Recovery
Plain git, with this project's safety rules on top. Before anything destructive, run git status --porcelain and account for every line — changes you did not make belong to another session (rule 21).
Rules for the risky operations
- Destructive = ask first.
git reset --hard,git branch -D,git clean, a force-push, or any history rewrite needs the human's approval (human-checkpoint) and a checkpoint tag before it runs:git tag checkpoint-$(date -u +%Y%m%dT%H%M%SZ).git reset --soft/git resetof an unpushed commit keep the changes and need neither. - Checkpoint over stash. Pause mid-task with a tagged
wip:commit (feature-branching§ Mid-task pause). A stash is for a tiny interruption resumed in the same session; label it (git stash push -m "wip: …") and never leave one across sessions — an old stash gets popped, committed, and resumed properly. - Merge, never rebase, to sync. Sessions share branches concurrently, and a rebase rewrites pushed history another session holds. Rebase +
--force-with-leaseonly with explicit approval; bare--forcenever;developandmainnever. - Lost commits stay in
git refloguntil gc expires them — by default 30 days for a commit no branch reaches:git checkout -b recover/<stamp> <sha>. - Sensitive data in history → human approval, then
git filter-repo --path <file> --invert-paths(notfilter-branch), and everyone who cloned must re-clone. - Cherry-pick sparingly — it duplicates history; merge related branches instead.
- Bisect with the project's test command (
git bisect run <test command>when it exits non-zero on failure), and alwaysgit bisect resetwhen done. - Deleting a merged branch:
git branch -d(refuses if unmerged) andgit push origin --delete <branch>;-Donly with approval.
Resolving conflicts
When a merge, rebase or cherry-pick reports CONFLICT (content), resolve every block on its merits — each side may hold correct logic, so never take one side wholesale — and complete it only once no marker remains and the full test suite passes: git commit with the generated merge message, or rebase/cherry-pick --continue (never a manual commit mid-rebase).
- An ambiguous block →
human-checkpoint, never a guess. - A failing suite after a correct-looking resolution means the merge itself may be wrong →
human-checkpoint. - In doubt with no human available: abort (
git merge --abort, orrebase/cherry-pick --abort), tag a checkpoint, andhuman-checkpoint.
docs/wiki/log.md merges by union and never conflicts, but may come out of order — node tools/workflow-mcp/verify.mjs --sort-log, committed with the merge.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

