Going back in time without losing the rest of your work
Sometimes you realize that one specific Git commit introduced a bug, broke your build, or simply wasn’t needed but you still want to keep all the other commits that came afterwards.
The good news is: Git lets you undo or revert a single commit without throwing away your later work. Here’s how to do it safely.