This is an old question, but perhaps it will benefit someone else.
You are right to do a git reflog , and you are right that there is nothing that could help you identify branches that have been deleted .. but thatβs good.
Suppose the remote branch was named special .
In a hypothetical situation, suppose you were on master , checked the new special branch, made some changes, committed them, returned to master , and then deleted special accident, possibly through some command like git branch -D special .
Run the git reflog and you will see this output.
ef15850 HEAD@ {411}: checkout: moving from special to master 64e7b02 HEAD@ {412}: commit: update special with stuff b444040 HEAD@ {413}: checkout: moving from master to special
You can find the name of the branch that you deleted. You will find it somewhere.
Since you cannot delete the branch in which you were active, you must leave this branch at some point in order to delete it.
You can go to the commit hash just before switching branches and create a new branch based on the remote.
In this case git checkout -b recovered_special 64e7b02
source share