How to Delete a Commit from Source Tree

As this was a bit of a head-scratcher for me I decided I would document exactly the steps on how to delete a commit which has been pushed to a remote repo.

Keeping it concise, so here goes:

  1. Select the commit you want to go back to
  2. Right-click and choose the option “Reset current branch to this commit
  3. Select your branch and choose option Push to → {branch}
  4. Make sure Force Push option is checked
  5. Push your changes

So that’s about it. I spent about 2 hours trying to work out something which seemed so simple, but now I know.

By Leo Acosta

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Warning: Use of undefined constant php - assumed 'php' (this will throw an Error in a future version of PHP) in /nfs/c08/h05/mnt/171085/domains/ on line 1