I have been working with git for just over a month. Indeed I have used reset for the first time only yesterday, but the soft reset still doesn\'t make much sense to me.
Another use case is when you want to replace the other branch with yours in a pull request, for example, lets say that you have a software with features A, B, C in develop.
You are developing with the next version and you:
Removed feature B
Added feature D
In the process, develop just added hotfixes for feature B.
You can merge develop into next, but that can be messy sometimes, but you can also use git reset --soft origin/develop
and create a commit with your changes and the branch is mergeable without conflicts and keep your changes.
It turns out that git reset --soft
is a handy command. I personally use it a lot to squash commits that dont have "completed work" like "WIP" so when I open the pull request, all my commits are understandable.