What problem does it solve?
Accidental git reset --hard, merge conflicts, detached HEAD states, or even repository corruption can lead to lost work and significant frustration. This Skill provides a comprehensive guide to diagnose and recover from common Git mistakes, saving you time and stress.
Core Features & Use Cases
- Recover Lost Commits: Utilize
git reflog and git fsck to find and restore deleted branches or commits, ensuring no work is truly lost.
- Fix Merge Conflicts: Get step-by-step guidance on resolving basic and complex merge conflicts, including how to use
git mergetool effectively.
- Undo Changes: Learn techniques for undoing local or public commits, discarding file changes, and recovering from botched rebases, safely.
- Use Case: A developer accidentally performs a
git reset --hard and loses several hours of work. This Skill guides them through using git reflog to identify the lost commits and restore their branch, saving their progress and reducing stress.
Quick Start
View local history of HEAD to find lost commits
git reflog
Recover a lost commit (e.g., abc123)
git cherry-pick abc123
Or create a new branch from it
git branch recovered-branch abc123