💾 Git’s Time Machine
Accidentally deleted branch? Reset to wrong commit? Reflog saves you.
# View all HEAD movements (last 90 days)
git reflog
# Output shows:
# abc1234 HEAD@{0}: reset: moving to HEAD~1
# def5678 HEAD@{1}: commit: Important work ← You want this!
# Restore that commit
git checkout def5678
git checkout -b recovery-branch
# Or reset current branch to it
git reset --hard def5678
Panic Recovery: Even after force push, hard reset, branch deletion – if commit was on your machine, reflog has it.
Time Limit: Git garbage collects after 90 days. Recover soon!





