Thanks for your help. I used update-ref and changed refs/heads/master to the sha1 of previous commit. Then I commit the changes. Everything seems fine now except (as you previously mentioned), git fsck -full complains about dangling trees. Is it critical? -Kasra On Tue, Jun 21, 2011 at 2:08 PM, Michael J Gruber <git@xxxxxxxxxxxxxxxxxxxx> wrote: > Kasra Khosoussi venit, vidit, dixit 21.06.2011 11:30: >>> Backup now! >>> I guess you've done that meanwhile anyways, but it's important before >>> any recovery attempts. >> >> Yes, I've done that. >> >>> Is your reflog OK, i.e. do you get proper output from "git reflog" or >>> "git log -g"? >> >> No. Before moving the corrupted object git reflog would return: >> fatal: object 0a83757505387aacc2fd36b3c996729e6bf9d6e5 is corrupted >> >> and after moving the file it would say: >> fatal: bad object HEAD > > Oh yes, stupid me, sorry. "git reflog" tries to parse HEAD. But you can > look at the file directly: > > tail .git/logs/HEAD > tail .git/logs/refs/heads/master > > etc. show you what's been going on with those refs lately. > > You should be able to pick the the sha1 before the corrupt one from that > and do things like "git log that_sha1" if only the most recent commit is > corrupt. > > Michael > -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html