error: Your local changes to the following files would be overwritten by checkout:
.idea/workspace.xml
......
Please, commit your changes or stash them before you can switch branches.
//第一种方式 存到暂存区
git add.
git stash
//取出的时候使用
git stash pop
//第二种方式 发起一个commit 存到提交历史
git add.
git commit -m "commit message"
原文:https://www.cnblogs.com/WeirJin-cloud/p/13038753.html