This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I accidentally deleted a git branch from both local and remote and also refreshed the page so the "recover" option was gone. | |
I didn't lose any code, since I had a backup copy. | |
But I did lose the commit history. | |
I was left with all code changes from all 16 commits in a folder. | |
This is what I did to recover the deleted local and dev branch: | |
1. git checkout master | |
2. git reflog | |
3. obtain the SHA of the top/latest commit on the deleted branch | |
4. get out of the reflog mode |