Skip to main content
1 of 2
Varun Garg
  • 2.6k
  • 24
  • 38

As pointed by Chris, I had following situation

git symbolic-ref HEAD fails with fatal: ref HEAD is not a symbolic ref

However git rev-parse refs/heads/master was pointing to a good commit from where I could recover (In my case last commit and you can see that commit by using git show SHA

I did a lot messy things after that, but what seems to have fixed is just,

git symbolic-ref HEAD refs/heads/master

And head is re attached!

Varun Garg
  • 2.6k
  • 24
  • 38