@SteveSummit The rule of thumb is Git will strive to not lose your work. Consider if it worked as you described. You're in the middle of resolving that big merge conflict, go to lunch, and when you come back your boss assigns you a new task. You thoughtlessly type
git checkout main
and poof all your work on the merge conflict is gone. On the flip side, if git checkout
can switch to another commit and still preserve your uncommitted changes it will do so. This is handy to move uncommitted changes between branches without having to stash and unstash them.