I open my Git repository using gitExtensions on Windows 7 for a Visual Studio project. It is suddenly empty. The repository exists, but all my commits have disappeared.
I am using the graphical interface and I believe this is the first time I've opened it since they updated it.
I'm unsure what to do about getting back my commits.
When I type
git log
I receive
fatal:bad default revision 'HEAD'
Update
After looking at https://stackoverflow.com/questions/1545407/recovering-broken-git-repository i tried
git fsck
it returned:
error: Invalid HEAD
fatal: loose object 36b7d9e1ca496bcb864c0b9c8671fcec97fbda31 (stored in .git/obj ects/36/b7d9e1ca496bcb864c0b9c8671fcec97fbda31) is corrupt
Committing returns:
error: unable to resolve reference HEAD: No such file or directory
fatal: cannot lock HEAD ref
and logging master branch returns
$ git log master warning: ignoring broken ref refs/heads/master. warning: ignoring broken ref refs/heads/master. fatal: ambiguous argument 'master': unknown revision or path not in the working tree. Use '--' to separate paths from revisions
Ill just keep pasting things that could be relevant
$ git reflog master
warning: ignoring broken ref refs/heads/master.
warning: ignoring broken ref refs/heads/master.
fatal: ambiguous argument 'master': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions
More possibly useful info: every single time i delete the corrupt file another one takes it's place. Im beginning to think its something to do with the master branch pointing to the wrong thing or something. because i assume the head is pointing to master.
One day later:
So I got my mate onto this, he was able to go through the logs and he said that the hashes in the logs don't match up to the objects in the folder. He tried resetting the master branch to the logs or something like that, I got a bit lost. Hope thats helpful