Git reset. What does it do? It's how you undo some changes that are local to your computer. When you have done some work that you need to rewind, reset is your friend. You can just start over. You can jump back and forth between the contents of various commits and do a bit of time traveling.
Full article