2

Possible Duplicate:
Git: removing selected commits from repository

I'd like to remove selected commmit from linear commit tree:

R->A->B->C->D->HEAD

I want to remove commit C and all changes which made in it.

Community
  • 1
  • 1
Vladimir
  • 12,753
  • 19
  • 62
  • 77

1 Answers1

1

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.

Greg Hewgill
  • 951,095
  • 183
  • 1,149
  • 1,285