Hacker News new | ask | show | jobs
by artpepper 3471 days ago
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.)
2 comments

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.