I'm fairly new at git, and I think I want to use rebase to fix my messed up history.
Here's my Git reflog. I want to make 2f6803d the most current commit, and have the history go 2f6803d fe6ab04 4f99c5d a335e24, without the stupid soft reset that I shouldn't have done. Also I'd like to change the commit message for 2f6803d so that it's got it's own message, instead of "foo." I think this is what rebase is for, but, like I said, I'm a noob here. How do I go about removing the bad commits from the history? The current state of my repo is the same as 2f6803d, and I'm able to work locally fine, but I can't push it because the soft reset at HEAD@{4} means it's not current with the repo.
I just cloned the remote repo, copied the current local repo over, and everything was fine, but I'd like to understand the git way of doing it.
Thanks in advance!
2f6803d (HEAD -> master) HEAD@{0}: reset: moving to 2f6803d
---some bad commits---
2f6803d (HEAD -> master) HEAD@{3}: commit: foo
4f99c5d HEAD@{4}: reset: moving to HEAD~ (This was my mistake!)
fe6ab04 (origin/master) HEAD@{5}: commit: foo
4f99c5d HEAD@{6}: commit: bar
a335e24 HEAD@{7}: commit: baz