I have two working branches, master and forum and I’ve just made some modifications in forum branch, that I’d like to cherry-pick into master. But unfortunately, the commit I want to cherry-pick also contains some modifications that I don’t want.
The solution would probably be to somehow delete the wrong commit and replace it with two separate commits, one with changes I want to pick in master, and others that doesn’t belong there.
I’ve tried doing
git reset --hard HEAD^
which deleted all changes, so I had to go back with
git reset ORIG_HEAD
So my question is, what is the best way to split last commit into two separate commits?