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[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!