title: Unable to Commit Git Changes. Error Message: fatal: cannot lock ref 'HEAD': unable to resolve reference 'refs/heads/master': reference broken
body: <p>I am getting the above error when tryping to commit changes in my repo.
  <code>git gc</code> returns the following:</p>
  
  <pre><code>error: bad ref for .git/logs/HEAD
  error: bad ref for .git/logs/refs/heads/master
  error: bad ref for .git/logs/HEAD
  error: bad ref for .git/logs/refs/heads/master
  error: inflate: data stream error (unknown compression method)
  fatal: loose object 3ee0ce38a1503fa8a00412a81ea64965c85d8943 (stored in .git/objects/3e/e0ce38a1503fa8a00412a81ea64965c85d8943) is corrupt
  error: failed to run repack
  </code></pre>
  
  <p>I don't really know how to resolve this sort of thing and other answers I have found to similar questions haven't done the trick.</p>