Git: Recover deleted (remote) branch
find out commit id
git reflog
recover local branch you deleted by mistake
git branch <NEED-RECOVER-BRANCH-NAME> commitId
push need-recover-branch-name again if you deleted remote branch too before
git push origin <NEED-RECOVER-BRANCH-NAME>
I'm not an expert. But you can try
git fsck --full --no-reflogs | grep commit
to find the HEAD commit of deleted branch and get them back.
just two commands save my life
1. This will list down all previous HEADs
git reflog
2. This will revert the HEAD to commit that you deleted.
git reset --hard <your deleted commit>
ex. git reset --hard b4b2c02