In a world of dogmatic specialists, it’s the generalist who ends up running the show. Is the CEO a better accountant than the CFO or CPA? Was Steve Jobs a better programmer than top coders at Apple? No, but he had a broad range of skills and saw the unseen interconnectedness. As technology becomes a commodity with the democratization of information, it’s the big-picture generalists who will predict, innovate, and rise to power fastest. There is a reason military “generals” are called such.
One of the most useful features of any version control system is the ability to “undo” your mistakes. In Git, “undo” can mean many slightly different things.
When you make a new commit, Git stores a snapshot of your repository at that specific moment in time; later, you can use Git to go back to an earlier version of your project.
In this post, I’m going to take a look at some common scenarios where you might want to “undo” a change you’ve made and the best way to do it using Git.