Have you ever pushed something you wish you hadn't? There is a simple solution to this problem. You can reset your latest commit and then push that to remote as if the commit never happened.
Warning: Doing so will remove that commit. This is detremental to repos that have collaborators on them. Only use these on branches only you have access to (feature branches) or on private repos. Using this method on the master/develop branch is highly discouraged.
# Roll us back to the last commit
git reset --hard HEAD^
# Push back to origin "as if it never happened."
git push origin -f
Let's say we really goofed and want to remove multiple commits? Simply add a number after the ~
symbol:
# Roll us back to the last 3 commits
git reset --hard HEAD~3
# Push back to origin "as if it never happened."
git push origin -f