Just learned that when you accidentally merge on the wrong branch and push, there is a way to change it.
git reset --hard [sha-commit-before-merge]
git push [origin] [branch] --force
This will undo the merge and any commits after the merge, so this is useful if you catch your mistake before any more commits happens.
Remove all your local git branches but keep master