Repair corrupted Git repository

前端 未结 9 1422
执念已碎
执念已碎 2020-11-30 06:27

My Git repository got corrupted after a couple of hard reboots due to power supply issues and now I\'m unable to fix it (I was in the middle of staging some files at the las

9条回答
  •  粉色の甜心
    2020-11-30 06:55

    My solution for a similar situation was to replace a hash of the damaged object in .git/refs/heads/my-working-branch with a hash of previous commit (which can be found in .git/logs/HEAD).

提交回复
热议问题