On a local repo, I\'ve just executed git cherry-pick SHA without any conflicts or problems. I then realized I didn\'t want to do what I just did. I have not pushed
To undo your last commit, simply do git reset --hard HEAD~.
Edit: this answer applied to an earlier version of the question that did not mention preserving local changes; the accepted answer from Tim is indeed the correct one. Thanks to qwertzguy for the heads up.