Last Updated: February 25, 2016
·
498
· clawfire

Recover a deleted branch, local & remotly

If you delete too quick your branch before merge some change, and delete it from your local and remote repository, don't panic.

First, find the commit SHA1 with this command :

git fsck --full --no-reflog | grep commit

Now you got your SHA1, feel free to git checkout [SHA1] to test if you got all you want and merge this commit ID on your dev branch, or restaure the previously deleted branch by using :

git branch [branchName] [SHA1]