Git
Reflog Commands
Reflog is your safety net - it records every change to HEAD, even those not in the commit history. Learn to recover from mistakes, find lost commits, and understand Git's reference logging system.
5 commands
Pro Tips
Reflog entries expire after 90 days by default. For important recovery, act sooner rather than later.
Use 'git reflog show branch-name' to see the history of a specific branch, not just HEAD.
After finding a lost commit in reflog, use 'git cherry-pick' or 'git reset' to restore it.
Common Mistakes
Reflog is local only - it won't help you recover commits that existed only on another machine.
Running 'git gc' can remove unreferenced commits. Don't garbage collect if you need to recover something.