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]
Written by Thibault Milan
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Git
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#