When working with git and especially GitHub, I often have commits on my local branch that were already submitted as a pull request. Sometimes I continue working and later notice that I have commits on the branch that have nothing to do with the next thing I am already working on. Therefore I want to remove them from the current branch.
$ git log --oneline @{upstream}.. e159d1e Commit C 70140e3 Commit B 16ed14a Commit A