title: Git repository corrupt (incorrect header check; loose object is corrupt)
body: <p>I experienced a power failure yesterday evening while writing a commit message. When I booted the machine back up I couldn't complete the commit. I ran <code>git reset</code>, added back the changed files, and tried again, and got this:</p>
  <pre><code>% git commit
  error: inflate: data stream error (incorrect header check)
  error: unable to unpack a94406345ac44982b00cf57b4b9660a35436637f header
  fatal: a94406345ac44982b00cf57b4b9660a35436637f is not a valid object
  </code></pre>
  <p><code>git fsck</code> reveals the following:</p>
  <pre><code>% git fsck --full
  Checking object directories: 100% (256/256), done.
  error: inflate: data stream error (incorrect header check)
  error: unable to unpack 4346883490a0990e68db0187241abc1642765a73 header
  error: inflate: data stream error (incorrect header check)
  fatal: loose object 4346883490a0990e68db0187241abc1642765a73 (stored in .git/objects/43/46883490a0990e68db0187241abc1642765a73) is corrupt
  </code></pre>
  <p>I notice the messages are complaining about different objects.</p>
  <p>I searched Stack Overflow and the Web and tried a few different things but to no avail.</p>
  <ul>
  <li>I don't have a recent backup copy.</li>
  <li>Cloning the repository into another directory doesn't help; the new repository exhibits the exact same problems.</li>
  <li><code>git stash</code> gives the same message as <code>git commit</code>. All the other git commands seem to work normally.</li>
  </ul>
  <p>How can I tell what is wrong and fix it?</p>
  <p><code>git log</code> output (just the first few lines):</p>
  <pre><code>% git log --oneline --decorate --all |head -n 8
  253b086 (HEAD, new_tokenize) Normalized tokenizer interface slightly
  0f2425a (master) Added procs to eval layer
  a4d4c22 Added procedures as a type
  d1e15ad (tag: v0.10) Added `if' form with tail call semantics
  f94a992 (tag: v0.9) Completed environments
  031116e Fixed bug where # on a line by itself caused segfault
  3d8b09f Added environments, define and set!
  01cc624 Put symbol table implementation into types.c
  </code></pre>
  <p>This is a small personal project; I usually just work in <em>(master)</em>, but I was doing an experiment at the time (new_tokenize). 253b086 was the last successful commit before the power failure.</p>