GIT - reverting merge (pull request gonne wrong)

Find a commit hash where merge occured to master and then

git revert -m 1 <commit-hash> 
git commit -m "Reverting the last commit which messed the repo."
git push -u origin master