Delete a specific commit knowing commit id
问题 Lets say i have a repo (git version 1.7.1) that contains following commits A -> B -> C -> D ->E and my HEAD is on E . Now i want to delete C while keeping everything same like A -> B -> D -> E . Can you help me how to do it? 回答1: You can do this with git rebase -i B . Note however, that D and E will be rewritten (get different commit SHAs), so the result will be A -> B -> D' -> E' . The content of E' should be equivalent to E (minus the changes that had been made in C which you are now