I committed D' based on B, but some one committed/pushed C on the remote repo. I pushed my D' to the remote repo. But unfortunately I noticed the remote repo merged D with C, and C is not a good commit. But now things are done. could I regret and make the branch commits list as A->B->D->E? By the way, there has no more new commit based on C.
CodePudding user response:
I suggest that you do not use --force
. A forward fix - rather than changing history - is safe and it's a good solution in almost all cases.
A forward fix could be:
- Fix what is broken in the code and commit it. Don't worry about history; just get the code working the way it should. Solved.
- In some cases
git revert C
is enough if you just want to get rid ofC
.