If you don't do this and you simply mess up terribly, You must use git reflog to go uncover your branch before messing it up, that's much more challenging, far more stress filled, plus much more error-inclined.Alternatively, You should use git stash or even more carefully git stash conserve "title description" to save your code in a pseudo commit.