title: Delete a commit from github
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/448919/how-can-i-remove-a-commit-on-github">How can I remove a commit on github?</a><br>
    <a href="https://stackoverflow.com/questions/1338728/how-to-delete-a-git-commit">How to delete a &#39;git commit&#39;</a>  </p>
  </blockquote>
  
  
  
  <p>So I'm trying to remove a commit from github.</p>
  
  <p>It is 3 commits ago and I'm ok if all the changes are lost.</p>
  
  <p>So based on questions from here, I did a </p>
  
  <pre><code>git reset --hard &lt;sha-commit-name-to-go-back-to&gt;
  git push -f origin HEAD^:master
  </code></pre>
  
  <p>Now it is gone from github as well as in git log. </p>
  
  <p>I then redid my changes and did </p>
  
  <pre><code>git add &lt;file I changed&gt;
  git commit
  git log
  </code></pre>
  
  <p>Everything looks fine.  There's no trace of the old commits.  So I finally did a:</p>
  
  <pre><code>git push
  </code></pre>
  
  <p>Now suddenly github has those three commits that I had removed.</p>
  
  <p>What am I doing wrong?  How to I keep the commits from returning?</p>