Git how to removed selected commit from tree? [duplicate]
Possible Duplicate:
Git: removing selected commits from repository
I'd like to remove selected 开发者_JS百科commmit from linear commit tree:
R->A->B->C->D->HEAD
I want to remove commit C and all changes which made in it.
You can do this using an interactive rebase operation. There's a good description of how it works in that link.
Essentially, you will rewrite commits so that instead of
R->A->B->C->D->HEAD
you have
R->A->B->D'->HEAD'
D'
is related to D
in that it introduces the same change, but is based on B
instead of C
. Note that if D
introduces changes that depend on C
, you may have a conflict you need to resolve.
精彩评论