There are different ways to solve this. It also partly depends on how your repository is set up.
If you want to get back to the state, in which the PR was not merged having two branches, you could reset the HEAD on master by one commit and force push the previous commit. This will rewrite history and may not be allowed on master. Also, it bears a risk to rewrite the git history. If you want to do this, you should know what you do.
Another option would be to just revert the merge commit. This will not undo the merge in the history, but the changed that were applied within the merge.
Now, after explaining these options, here are the commands required to perform those actions.
Delete merge commit and rewrite git history
git checkout master
git reset HEAD~1
git push -f
Revert changes applied in the merge commit
I would recommend trying this.
git checkout master
git revert HEAD
Both of these options assume that the merge commit on master is the last commit and no commit was done after it.