2 It's "unsafe" if it does exist now but has the "wrong" contents.
#Emergenyc staging branch code update
![emergenyc staging branch code emergenyc staging branch code](https://i.ebayimg.com/images/g/R3UAAOSwl89ftlqd/s-l300.png)
If Git won't let you switch, you already have a remedy: use git stash or git commit or, if your changes are trivial to re-create, use git checkout -f to force it. Both do the same thing, when used in the basic ways. Sidebar: git stash save is the old syntax git stash push was introduced in Git version 2.13, to fix up some problems with the arguments to git stash and allow for new options. You can then git stash apply them after switching. Note that git stash save or git stash push actually means "Commit all the changes, but on no branch at all, then remove them from where I am now." That makes it possible to switch: you now have no in-progress changes. You may want to use git stash to save them this is one of the things it's designed for.
![emergenyc staging branch code emergenyc staging branch code](https://cdn.cloudflare.steamstatic.com/steamcommunity/public/images/clans/26753975/839c4162c8c93f34346a726a33134e1034621c23.png)
If Git won't let you do it, you have to commit your changes, to save them somewhere permanent. Sometimes Git says "OK, you're on branch2 now!" Sometimes, Git says "I can't do that, I'd lose some of your changes." The observation here is that, after you start working in branch1 (forgetting or not realizing that it would be good to switch to a different branch branch2 first), you run: git checkout branch2 (My own preference is to just commit anyway, avoiding git stash and not trying to be too tricky, but others like other methods.) It is not a recommendation to engage in any particular workflows. This answer is an attempt to explain why Git behaves the way it does.