Junior dev ran `git push --force` on main, wiping 6 commits. Production broken.
Your local still has old refs from last fetch. Reflog is the lifeline.
Hard · 5 steps · +750 XP
This scenario walks through 5 steps, in order:
Try the terminal first — you learn more by doing. When you want to check yourself, here is the command for each step.
git refloggit branch recovery HEAD@{1}git reset --hard HEAD@{1}git push --force-with-lease origin maingit log --onelineEnable branch protection. Require PRs. Disable force-push on main.