Imagine a scenario where you have a git repo with 2 branches;
master, the production-ready branch and
dev, the branch where all the development occurs.
Now imagine that you accidentally made a commit on
master, when really it should have been on
dev. If you have not yet pushed to a remote repository (like Github), you can undo that commit using
git reset like so: