- Right click on the commit you like to reset to (not the one you like to delete!)
- Select "Reset master to this commit"
- Select "Soft" reset.
A soft reset will keep your local changes.
Source: https://answers.atlassian.com/questions/153791/how-should-i-remove-push-commit-from-sourcetree
Edit
About git revert: This command creates a new commit which will undo other commits. E.g. if you have a commit which adds a new file, git revert could be used to make a commit which will delete the new file.
About applying a soft reset: Assume you have the commits A to E (A---B---C---D---E) and you like to delete the last commit (E). Then you can do a soft reset to commit D. With a soft reset commit E will be deleted from git but the local changes will be kept. There are more examples in the git reset documentation.
- Right click on the commit you like to reset to (not the one you like to delete!)
- Select "Reset master to this commit"
- Select "Soft" reset.
A soft reset will keep your local changes.
Source: https://answers.atlassian.com/questions/153791/how-should-i-remove-push-commit-from-sourcetree
Edit
About git revert: This command creates a new commit which will undo other commits. E.g. if you have a commit which adds a new file, git revert could be used to make a commit which will delete the new file.
About applying a soft reset: Assume you have the commits A to E (A---B---C---D---E) and you like to delete the last commit (E). Then you can do a soft reset to commit D. With a soft reset commit E will be deleted from git but the local changes will be kept. There are more examples in the git reset documentation.
If you select the log entry to which you want to revert to then you can click on "Reset to this commit". Only use this option if you didn't push the reverse commit changes. If you're worried about losing the changes then you can use the soft mode which will leave a set of uncommitted changes (what you just changed). Using the mixed resets the working copy but keeps those changes, and a hard will just get rid of the changes entirely. Here's some screenshots:

How to clear Sourcetree push status
git - How do you revert with sourcetree? - Stack Overflow
How to delete commit from GiHub and remove it from SourceTree ?
git - Undo merge in sourcetree - Stack Overflow
I've accidentally committed and pushed the commit from Source tree onto GitHub, turns out the the stuff I pushed belonged to a wrong project.
I'd like it removed from both my GitHub commits and from Source tree, I right clicked my latest commit on SourceTree and clicked reverse commit in the hopes that it would work. However, I've realized that thing related to source tree and github can be quite complex if you don't know the exact way to do it.
SourceTree latest Commit. GitHub last commit.Any advice would be greatly appreciated.
When you push a commit, the safest way to revert it (rather than forcing the push with -f) is to use the revert function, so a new commit is created on top of your previous commit.
This is possible to do using Sourcetree, right clicking in the commit that you want to revert, and selecting "Reverse commit...".

You would need to do this for each commit you want to revert, in reverse order.
The best way to do this is with Reset <branch> to this commit option shown in the image below.

A pop up will be displayed to you to choose what mode of code reset you would like to choose. [See below]

Note: This is not exactly code reversal, but it removes your commit entirely from the local and makes it look cleaner.

