I made some local changes and then committed them (let's call this commit A). I then made and committed some more small changes (commit B), and since I didn't want to clutter up my commit history with a bunch of small changes, I tried to squash commit B into commit A. Basically I wanted the remote's commit A to represent what I had in my local immediately after making commit B.
I tried git rebase -i HEAD~3, and squashed commit B into commit A.
This then reverted the local branch to what it was before BOTH A and B. I managed to revert this using git rebase --abort, but I am confused as to why this happened, especially as I have used git rebase -i HEAD~N in the past to achieve the desired results.
Would be easier to
git reset HEAD~2 —softand commit again.As to why your commits were lost, I’m not sure, normally this should work if you use the interactive rebase to squash commit B into A: