title: git not detecting single-bit error in a tracked file
body: <p>I recently discovered a single-bit error in a binary file that was included in a Git repository:</p>
  <pre><code>$ diff &lt;(xxd old-clone/file) &lt;(xxd new-clone/file)
  &lt; 00251230: 0412 c2bd 2e61 efeb 21b4 d904 3388 2539
  ---
  &gt; 00251230: 0412 c0bd 2e61 efeb 21b4 d904 3388 2539
  </code></pre>
  <p>Concerningly, git had <em>not</em> detected that anything was awry. I only found the problem because one of our tests had mysteriously begun to fail, without any committed changes.</p>
  <p>When I did a fresh clone of the repository from the server, the test passed again. I now have a situation where I have two copies of the repo, both checked out at the same commit and both reporting a clean working tree, but with clearly different versions of this file:</p>
  <pre><code>$ cd old-clone &amp;&amp; git status &amp;&amp; cd ..
  HEAD detached at 251265a4
  nothing to commit, working tree clean
  $ cd new-clone &amp;&amp; git status &amp;&amp; cd ..
  HEAD detached at 251265a4
  nothing to commit, working tree clean
  $ diff old-clone/file new-clone/file
  Binary files old-clone/file and new-clone/file differ
  </code></pre>
  <p>I've confirmed that:</p>
  <ol>
  <li>This file is definitely being tracked (not in <code>.gitignore</code>, not marked <code>--assume-unchanged</code>)</li>
  <li><code>git fsck</code> reports no issues in either repo</li>
  </ol>
  <p>My understanding was that this is supposed to be <a href="https://git-scm.com/book/en/v2/Getting-Started-What-is-Git%3F" rel="nofollow noreferrer">impossible</a>:</p>
  <blockquote>
  <p>Git Has Integrity: Everything in Git is checksummed before it is stored and is then referred to by that checksum. This means it’s impossible to change the contents of any file or directory without Git knowing about it. This functionality is built into Git at the lowest levels and is integral to its philosophy. You can’t lose information in transit or get file corruption without Git being able to detect it.</p>
  </blockquote>
  <p>My belief in git's ability to maintain data integrity has been severely shaken.</p>
  <p>How can this happen? And how can I ensure that it doesn't happen again (ideally without having to do a fresh clone of the entire repo every time)?</p>