I have accidently deleted my branch from the repo without merging the branch into another. Is there a way I can recover files and that branch itself or I can't?
Asked
Active
Viewed 278 times
1 Answers
2
Branch is really a label to a commit. And commit are rarely removed - only when there is not enough space or you explicitly do a garbage collection.
You can look at the previous HEAD which is a label for your currently checked-out branch with git reflog
. When you find the commit you are interested in, you can check it out and make a new branch pointing to this commit.

Bartlomiej Lewandowski
- 10,771
- 14
- 44
- 75
-
using git reflog I am able to see the commits that I did in the deleted branch. Will work on further.Thanks. – worrynerd Jun 23 '15 at 18:42