Git reset, as talked about in lots of answers in advance of, is by far the ideal and simplest way to realize what you wish. I use it in the next workflow: I found Felix Rieseberg's Resolution being the best. This really is my marginally shorter transcription of his assistance: https://bigchiefduoallinoneliquid13456.blogolize.com/the-best-side-of-luigi-oil-series-4-78556273