Git reset, as talked about in many solutions ahead of, is certainly the top and most basic way to realize what you want. I use it in the next workflow: I discovered Felix Rieseberg's solution for being the top. This really is my a little shorter transcription of his advice: https://big-chief-duo-all-in-one78901.blogocial.com/little-known-facts-about-awful-lot-of-cough-syrup-snowcaps-75878884