Removing the last commit to the master branch after pushing to the origin

Posted on 29 Dec 2016 AWS

So you’ve added a commit to the master branch and pushed it to the origin.
To remove it cleanly can be frustrating when things become time sensitive. To keep things simple and straightforward add this alias to your .git/config and simply execute git resetorigin.

resetorigin = !git fetch origin && git reset --hard origin/master && git clean -f -d

2 thoughts on “Removing the last commit to the master branch after pushing to the origin”

  1. you’re actually a just right webmaster. The website loading velocity is incredible. It seems that you are doing any distinctive trick. In addition, The contents are masterpiece. you’ve done a great activity in this topic!

    1. Cheers, thanks no tricks just refining techniques over time.
      Please let me know if you have any other questions or want to share any techniques.

Leave a Reply

Your email address will not be published.

*