How can I remove a specific git commit from the repository?
For eg I have commit like A-B-C-D-E and I want to remove the C commit to have A-B-D-E, then how can I accomplish this?
How can I remove a specific git commit from the repository? For eg I
Share
Easisest way I would think is to do
git rebase -i B, remove the line for C in the text that git presents and save and let git do the rebase. Note that history will become A-B-D2-E2 ( and can never become A-B-D-E)Note that rewriting history is not always good. If you have published ( pushed) try doing
git revert Cas that is more safe. the history will become like A-B-C-D-E-C’