title: How to permanently remove (or hide) a commit from a GitHub PR after force pushing
body: <p>In order to remove commits from a GitHub repository, the typical advice is to locally remove the commit (e.g., via <code>git rebase -i</code>) and <a href="https://stackoverflow.com/questions/448919/how-can-i-remove-a-commit-on-github">force-push the modified branch over the original remote branch</a>.</p>
  <p>However, if the remote branch in question is part of a pull request, GitHub now helpfully displays the message</p>
  <blockquote>
  <p><code>&lt;user&gt;</code> force-pushed the <code>&lt;remote_branch&gt;</code> branch from <code>&lt;old-commit&gt;</code> to <code>&lt;new-commit&gt;</code></p>
  </blockquote>
  <p>and displays a link to view the diff between <code>&lt;old-commit&gt;</code> and <code>&lt;new-commit&gt;</code>. (This seems to be a recent change, I do not remember encountering this message before.)</p>
  <p>According to <a href="https://stackoverflow.com/questions/4367977/how-to-remove-a-dangling-commit-from-github">another answer here</a>, GitHub should periodically remove commits that are no longer referenced. But since they do reference the old commit in their UI, I suspect they will preserve it. (I haven't seen this apparently new feature for long enough to be sure and have not found any official mention of it yet.)</p>
  <p>Is it possible to delete the remote commit in a way that prevents other users from seeing that commit? Or is it at least possible to remove the message above from the PR discussion page?
  Is there any other way to alter the contents of the underlying branch of a PR without everyone being able to access the old commits from the PR page (at least unless they know the commit hash)?</p>
  <p>(This question is not about removing sensitive information such as passwords - I am aware that these should be considered compromised regardless of the possibility of removing the commit afterwards.)</p>