Re:A Git catastrophe cleaned up
by artpepper on Wednesday December 21, 2016 @01:08PM
(#13231224)
But how do you revert a commit if there were subsequent commits that changed the same files? (If I'm reading the original post correctly.)
[ Parent
| on HN ]
Re:A Git catastrophe cleaned up
by joatmon-snoo on Wednesday December 21, 2016 @02:08PM
(#13231728)
I think grandparent meant a "git revert", which is actually a distinct operation (introduce a commit which is the inverse of a given commit) from resetting a branch pointer.
Well, in the worst case, you can literally revert all subsequent commits, merge the topic-branch, then reapply the commits.
In most real situations you'll probably find that only a small number of commits actually need to be reverted and reapplied, especially if your team is good about having reasonably self-contained commits.
If you're concerned about filling the git logs up with noise, you can always do use rebase to combine any revert/re-revert commits into single log entries.