Problems with corrupt git repo

First: Make a backup of your .git directory in case you corrupt things more in this process. Then:

  • Put back the best version of the packfiles you have available.
  • For each of the corrupt packfiles, run:

    mv .git/objects/pack/pack-**yourpack**.pack oldpack
    git unpack-objects -r < oldpack
    
  • Run git fsck --full and git checkout again, give us the output.

  • Looks like now you should be able to check out, but you will have to run git checkout -f **yourbranch**, as you have changes in your working dir that are not yet committed. These changes will get lost when you run git checkout -f, though.