I made quite few changes in my project (I was working on a remote branch and not the master), I committed them and created a pull request on BitBucket and merged the branch
It's very unfortunate that SourceTree doesn't make it easy for you to revert merge commits (at least in Windows SourceTree 1.5.2.0). However, reverting the merge can easily be accomplished from the command line, but do you want to revert the merge by adding another commit that is the reverse of the results of the merge commit, or do you want to just remove the merge commit from history altogether?
If you're not sharing your master branch with other people, the simplest thing
to do would be to simply do a hard reset to remove the merge commit from
history. However, if other people already have a copy of that merge commit, then
you'll create extra work for them as they try to re-sync their copies of
master with the rewritten version of yours.
So you need to figure out which option you want to use. I will give the steps for both, using the command line:
git checkout master
git push origin master --force
That will overwrite the merge commit on origin/master with the current state
of your local master branch, thus removing the merge commit.
git checkout master
git merge origin/master
git revert -m 1 HEAD
That will bring your local master branch in-sync with origin/master, and
then you can add a reverse commit by telling git revert that the
1st parent is the one that should be considered the "mainline"
parent, and it will create the reverse commit relative to the changes brought in
from the other parent commit.
If later on you decide that you want to bring in the changes from the other parent again, then you'll need to add another reversion commit that reverts the reversion commit that you just made (a technique known as "reverting the revert").
See also: