You have 2 options here to do that either to discard all your outgoing commits OR to undo specific commit ..
1- Discard all your outgoing commits:
To discard all your outgoing commits For example if you have local branch named master from remote branch, You can:
1- Rename your local branch from master to anything so you can remove it. 2- Remove the renamed branch. 3- create new branch from the master
So now you have a new branch without your commits ..
2- Undo specific commit: To undo specific commit you have to revert the unneeded by:
1- Double click on the unneeded commit. Double click on the unneeded commit 2- Click on revert Click on revert
But FYI the reverted commit will appear in the history of your commits with the revert commit ..