Last Updated: September 09, 2019
·
1.507K
· javierg

Recover "accidentally" deleted branch

Or how reflog save me

To recover any removed branch, you can do:

git reflog

This will bring the sha1 for your commits. select the one where your killed branch was left on. Then:

git branch <sha1>

That will resurrect your dead branch, and save you from redoing everything again.