Recover deleted branch in Git
This question already has an answer here:
Can I recover a branch after its deletion in Git?
2 Solutions collect form web for “Recover deleted branch in Git”
Create a list of all dangling or unreachable commits.
git fsck --full --no-reflogs --unreachable --lost-found
Print a list of commit messages for all commits in the lost and found.
ls -1 .git/lost-found/commit/ | xargs -n 1 git log -n 1 --pretty=oneline
Find your missing commit through the process of manual inspection (i.e. reading).
Create a new branch with the missing commit as the branch head.
git checkout -b branch-name SHA
Having got the potential sha1 for the last tip of branch
gitk sha1 to actually browse the commit’s history to check you have the right one.