Lost a git commit
I have the hash for a git commit I made a few weeks ago. I tried checking it out but it says that the hash “did not match any file(s) known to git”. I also looked for it in git reflog, but don’t see it there. I don’t see the earliest commits I made in reflog either.
I couldn’t find the missing commit in my remote repository in Gitorious either. However, I do see the earliest commits I made in Gitorious, just not the one I’m looking for.
- What user will Ansible run my commands as?
- Access svn repository on windows host from linux redhat
- How do I download a tarball from GitHub using cURL?
- Add previously ignored directory to Git repository
- http 401.1 error while performing a GIT clone from a Linux server
- How to get diff between all files inside 2 folders that are on the web?
One Solution collect form web for “Lost a git commit”
Well, the commit no longer exists in your database, which is unfortunate. Start with a
git lost-found just in case you have the hash wrong.
If it disappeared because it was garbage collected, you’re out of luck. If it disappeared for any other reason (disk corruption, file system bug, etc.), you may still be able to find the blobs that were in that commit.
git fsck can tell you if there are any problems with git’s internal database. If that doesn’t turn up anything, try this: How to recover LOST WORK resulting from the use of git?