Git-repair can repair various forms of damage to git repositories.
It is a complement to git fsck, which finds problems, but does not fix them.
As well as avoiding the need to rm -rf a damaged repository and re-clone, using
git-repair can help rescue commits you've made to the damaged repository and
not yet pushed out.