Git reset, as outlined in many solutions right before, is undoubtedly the top and most straightforward way to realize what you want. I use it in the next workflow: I discovered Felix Rieseberg's Alternative to generally be the top. This is certainly my a little shorter transcription of his suggestions: https://collinhrelg.blog-a-story.com/21572652/the-basic-principles-of-duo-liquid-diamonds