git - Easier way to revert commit -
i have repo such history:
h | c | m |\ | x | | | b | | | |/ r now need revert x commit. problem - there many commits hidden under m-c-h, files need totally rewritten. there trick simplify this?
use git rebase -i delete commit x, , subsequent ones rebased automatically.
so if xxx sha commit x, run:
git rebase -i xxx^ and edit file delete (or comment) line says xxx
pick xxx x commit < delete line pick mmm m commit pick ccc c commit pick hhh h commit once save file perform rewriting. if there conflicts introduced doing this, you'll need resolve them manually, perform git add on conflicted file, , when done, git rebase --continue
Comments
Post a Comment