We accidently merged develop to master and pushed master to origin. Now I wish to restore master to it's prior state (before the merge of develop to master). In SourceTree, I right-clicked the prior version of master and selected 'Reset current branch to this commit', and selected 'Hard' and my local master is good. Can I then, just right-click the Remotes/origin/master version in the left navigation bar and select 'Delete origin/master', and then push that result? I am on a small team, so controlling what the rest of the team does, it easy.
Followup:
We are using Bitbucket Cloud, and we normally have our setting set to disallow deleting develop and master. I temporarily turned off the restriction on deleting master, in order to delete it, but it still prevented the delete saying: 'remote: permission denied to delete branch master[K'
Also tried to do the reverse commit but SourceTree would not do that either Saying: 'git -c diff.mnemonicprefix=false -c core.quotepath=false revert --no-edit 3fa61aa...4f
error: Commit 3fa61aa...4f is a merge but no -m option was given.
fatal: revert failed'
Solution:
I was finally able to accomplish my desired task by turning off the 'Prevent history re-writes (rebase) on these branches' in Bitbucket Settings/Branch management, and then used Git command line:
git push -f
Then I added master branch back to 'Prevent history re-writes (rebase) on these branches' section, to ensure no one does this kind of thing by accident.