I was working on a branch and needed to get back on master for a quick fix so I committed my work in progress.
Now I am back in my branch and I would like to get back to the state where I haven't committed but all my changes are applied and ready to be committed (i.e. cancel the previous commit but my changes are not lost and they are shown in git status
).
Amending the previous commit is not good enough for me as I want to see the changed files and lines (it makes it easier to work on my change).
I know git stash would have been a better solution but it's too late. I also tend to mix up (or loose) my stashed commits as they are not linked to a branch.