I had the same issue when switching from a dev branch to master branch. What I did was commit my changes and switch to the master branch. You might have uncommitted changes.
And also you can try this git reset --merge as well. This can be used to resolve any conflicts and revert.