Here is the technique -
Method 1 : Cherry-pick Your Commits alone.
I guess, you do not have to think about others commit. So just pick your commits and go ahead.
Commands to follow:
Assuming commit x & y are committed by you.
Assuming you are in the branch (jira branch)
a. git fetch origin
b. git log --oneline -30 #Note down your commit ID somewhere (x&y)
c. git reset --hard origin/master #BE CAREFUL there should not be any non committed files. Which will destroy this command, if any!
d. git cherry-pick commit-x
e. git cherry-pick commit-y
g. Do the required code changes for reverting
h. git commit.. new changes f. git log --oneline -20 #to confirm
Method 2 : Use revert command.
Assuming commit-a and commit-b you want to revert
a. git revert commit-a
b. git revert commit-b
Please note, this will create new two commits above all.