title: Git filter-branch gave me two sets of commits
body: <p>I needed to remove a file from my commit history. I followed <a href="https://help.github.com/articles/remove-sensitive-data" rel="noreferrer">Github's instructions for removing sensitive data</a>:</p>
  
  <pre class="lang-bash prettyprint-override"><code>$ git filter-branch --force --index-filter \
  'git rm --cached --ignore-unmatch &lt;myfile&gt;' \
  --prune-empty --tag-name-filter cat -- --all
  </code></pre>
  
  <p>...but I must have done something wrong, because now I have a bunch of duplicate commits. One set of commits still has my file; the other doesn't. Other than that, they're identical. How can I delete all of the commits that still contain my file?</p>