I've read many posts related to this issue today( one useful one here: Fix a Git detached head? & Why did my Git repo enter a detached HEAD state?).
Today I've been scratching my head. I'm not able to understand how to fix this even after reading those articles.
Yesterday was all ok, I remember having given a checkout command. In the evening I found that Git was not showing any changes even though local changes were present. After researching today I could see now that git status is showing "HEAD detached from 99f040f".
Since then I removed .git folder in my D: (on my Windows 7) and restored .git of 27th July backup. Still not resolved. I tried 25th July version too. But no luck. So I've now restored yesterday's .git version.
I'm pasting the screenshot from gitk. Is there anything I can do to correct this issue?