[Question] Git recovery with HEAD commit broken
- From
- Shilong Wang <wangshilong1991@gmail.com>
- Date
- Dec 11, 2013, 14:38 UTC
- Message-ID
- <CAP9B-Q=ARp00Bj5zJ0J=3qv9R16YGu5AZgLpqoO0y+cY1at1Zw@mail.gmail.com>
I am not a developer for git, but i am a regular user with git, i came the following problem:
A power off cause my top commit broken, and then git branch/log/reflog..etc won't work. I do a hack that i change the HEAD commit to the one that i can make sure is right, and then i do:
# git reset --hard HEAD
In fact, i hope git fsck can fix up such problems(maybe can backup top commit for example)... Someone has faced such problems or have some suggestion for this?
Thanks, Wang