If I run git branch -d XYZ
, is there a way to recover the branch? Is there a way to go back as if I didn\'t run the delete branch command?
I did this on the computer which i delete the branch:
git reflog
response:
74b2383 (develope) HEAD@{1}: checkout: moving from master to develope
40ef328 (HEAD -> master, origin/master, origin/HEAD) HEAD@{2}: checkout: moving from develope to master
74b2383 (develope) HEAD@{3}: checkout: moving from master to develope
40ef328 (HEAD -> master, origin/master, origin/HEAD) HEAD@{4}: reset: moving to HEAD
40ef328 (HEAD -> master, origin/master, origin/HEAD) HEAD@{5}: clone: from http://LOCALGITSERVER/myBigProject/Android.git
and i retrieve the branch with this command:
git checkout -b newBranchName 74b2383