What if only the submission of one commit in the middle is revoked?

commit A-> commitB-> commit C-> commit D
now I want to undo the changes to commitB or submit them backwards.

Git
Feb.27,2021

two cases:
1, not yet push to remote
at this point, you can first git reset-- HEAD CommitA
and then git cherry-pick CommitC CommitD
PS:. It is best to ID copy the CommitC CommitD first to facilitate operation.

2, has been push to remote
can only be processed through git revert CommitB at this time.

Menu