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 && g