geoffjay avatar

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-code

Installs 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

More from geoffjay/claude-plugins

All 3
1davila7 avatarcreate-prdavila7/claude-code-templatesCreate pull requests following Sentry conventions. Use when opening PRs, writing PR descriptions, or preparing changes for review. Follows Sentry's code review 314skills.sh installs
2marcelorodrigo avatarcreate-prmarcelorodrigo/agent-skillsCreate Pull Requests following best conventions. Use when opening PRs, writing PR descriptions, or preparing changes for review.311skills.sh installs
3kkkkhazix avatargithub-to-skillskkkkhazix/khazix-skillsAutomated factory for converting GitHub repositories into specialized AI skills. Use this skill when the user provides a GitHub URL and wants to "package", "wra260skills.sh installs
4decebals avatarchangelog-generatordecebals/claude-code-javaGenerate changelogs from git commits. Use when user says "generate changelog", "update changelog", "what changed since last release", or before preparing a new 251skills.sh installs
5everyinc avatarchangelogeveryinc/compound-engineering-pluginCreate engaging changelogs for recent merges to main branch245skills.sh installs
6openai avatarpr-draft-summaryopenai/openai-agents-pythonCreate the required PR-ready summary block, branch suggestion, title, and draft description for openai-agents-python. Use before the final response whenever the236skills.sh installs