Normally if I make changes in a branch and realize I meant to do it in a different branch, then I can simply stash the changes and then checkout the branch I want.
How do I effectively accomplish the same thing if I've already committed locally (but not pushed to remote)?
I want my local branch to be as though I never made any changes... in particular I don't want to have to push two commits (one with the changes, and one that reverts the changes). I just want the commit to go away as if it never happened. And when I checkout the branch I want, I want my changes to be there... or I want to be able to restore them (as changes, but not as a commit, obviously).
I've done some searching and the answers I've found primarily focus on the first case I mentioned where changes weren't committed. It's very possible I've run across the exact answer I need, but didn't realize it because I wasn't 100% if the scenario was the same as mine. So obviously I'm a bit new to git and I'm sure this has got to be a duplicate question, but maybe I am just having trouble identifying which existing questions are the duplicates with confidence.
Also I tagged vs 2017 and 2019 because I use both and welcome any answers that explain how to do this through the IDE in either of those versions in additions to how to accomplish this in a shell.
EDIT: Just thought I should add that this particular commit is the only one. Though I am interested to hear solutions for both scenarios (this one, and one where I had other valid commits).