
Git Troubleshooting
When you're staring at "detached HEAD" or just accidentally nuked three hours of work with a bad reset, this walks you through the recovery. It covers the reflog forensics, fsck for finding dangling commits, conflict resolution with three-way diffs, and the full rebase recovery dance. The real value is in the specific commands for each mess you can make: recovering deleted branches, fixing corrupted pack files, undoing public commits with revert instead of reset. It's basically the runbook you wish you had bookmarked at 11pm when git stops making sense. Honest take: if you've ever Googled "git undo" in a panic, you'll reference this repeatedly.
- skills.sh installs
- 346
- GitHub stars
- 8
- last updated
- Aug 21, 2026
Install
$ npx -y skills add geoffjay/claude-plugins --skill git-troubleshooting --agent claude-codeInstalls into .claude/skills of the current project.
Files
Git Troubleshooting Skill
This skill provides comprehensive guidance on diagnosing and resolving git issues, recovering from mistakes, fixing corrupted repositories, and handling common error scenarios.
When to Use
Activate this skill when:
- Encountering git error messages
- Recovering lost commits or branches
- Fixing corrupted repositories
- Resolving detached HEAD state
- Handling botched merges or rebases
- Diagnosing repository issues
- Recovering from force push
- Fixing authentication problems
Recovering Lost Commits
Using Reflog
# View reflog (local history of HEAD)
git reflog
# View reflog for specific branch
git reflog show branch-name
# Output example:
# abc123 HEAD@{0}: commit: feat: add authentication
# def456 HEAD@{1}: commit: fix: resolve bug
# ghi789 HEAD@{2}: reset: moving to HEAD~1
# Recover lost commit
git cherry-pick abc123
# Or create branch from lost commit
git branch recovered-branch abc123
# Or reset to lost commit
git reset --hard abc123
Finding Dangling Commits
# Find all unreachable objects
git fsck --lost-found
# Output:
# dangling commit abc123
# dangling blob def456
Sponsors
Details
- Repository
- github.com/geoffjay/claude-plugins
- Categories
- Git & Pull Requests, Debugging
- First seen
- Jun 3, 2026