- Apr 2016
When .git/HEAD is gone, git doesn't even think your repository is a repository. So really, we must fix this first or else we will not be able to use any git commands to salvage the rest.
After a recent power outage, a call to 'git status' returned this:
fatal: Not a git repository (or any of the parent directories): .git
When I inspected .git/HEAD, it was filled with what looked like binary code, rather than a string like:
echo 'ref: refs/heads/develop' > ./git/HEAD
did the trick!