I know there're already lots of questions like that but nevertheless, if possible, I would prefer to double check if I'm doing it right cos the last thing I want is a messed up commit tree. I accidentally merged the so called stage branch into my task branch and pushed it to the remote. These are the latest commits on my task branch:
commit 0b7215203eb10cb11bba94147b170ca51a45e8b2 (HEAD -> ISSUE-1771, origin/ISSUE-1771, stage)
Merge: 87f0fc3 d3e6f17
Author: AUTHOR
Date: DATE
Merge branch 'stage' of PATH_TO_PROJECT into ISSUE-1771
commit 87f0fc31b94b68e10d3b49a19facf4474a1799d6
Author: AUTHOR
Date: DATE
COMMIT_MESSAGE
Now I would like to revert the commit and I'm going to do this in the following way:
$ git checkout ISSUE-1771 && git revert 87f0fc3 -m 1
which, unless I'm very much mistaken, is supposed to revert the tree back to what it was in 87f0fc3.
So after I do the reversion I'm going to push to the remote task branch like so:
$ git push origin ISSUE-1771
then checkout stage
and pull the changes from the ISSUE-1771
branch, it will merge them into stage
and then push to the remote stage
.
So it should go like this:
$ git push origin ISSUE-1771
$ git checkout stage && git pull origin ISSUE-1771
$ git push origin stage
Is this correct?