Removing a branch simply removes the shortcut attached to the commit. The end, which used to be the head of the branch, is still present. You just need to return the shortcut.
If you combined hotfix in master and created a merge commit in aabbcc , then you can resurrect hotfix using:
git branch hotfix aabbcc^2
^2 is short for "second parent." If you did not create merge commits, simply recreate hotfix using the last of your commits:
git branch hotfix ddeeff
Of course, if you know ddeeff even in the case of the merge above, you can use the latter commit directly.
source share