I have a tricky situation. I need to remove and re-commit some commits that I already pushed to github remote repo. But these commits are not HEAD anymore (people pushed theirs on top of it).
I understand I can do revert commits, therefore preserving the commit history. But the requirement is to let wrong commits disappear.
So:
D <- other people's commit
|
C <- B and C are wrong commits! They need to be removed
| <- The changes that should be preserved from B and C will be
B <- committed on top of D
|
A <- this was the initial state
To give more explanation, I'm using 2 different GitHub accounts for work/personal. I accidentally committed B and C to company repo using personal GitHub account. So, I need to remove these commits from non-employee account