3 ms·
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.)
by artpepper 10y 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.)
- joatmon-snoo 10y agoI 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.
- nolemurs 10y agoWell, 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.