I have a repository where I commit once a week every Thursday.
Today, after committing, when looking at the log, I noticed that I had made a commit on Wednesday last week.
But those changes should have been committed on Thursday last week!
It seems I accidentally ran a commit back on that Wednesday, that I thought I had aborted.
I tried git rebase -i
, but it only lets me squash
the newer Thursday commit into the older Wednesday one, resulting in one commit on Wednesday. I want the reverse! fixup -c
looks like it might do what I want, but it may not, and then I would not know how to recover.
Reordering commits (as suggested in an answer to a similar question) also doesn’t seem to fit the bill, as I want the newer commit description and time stamp, and discard the old one.
So: How do it get there to be only the Thursday commit for last week, with the Wednesday commit changes being part of it. as if it never happened?