git: Switch branch and ignore any changes without committing.
- by boyfarrell
Hello,
I have got the git branch I'm working on to a nice place. So I make a commit with a useful commit message. I then absentmindedly make minor changes to the code that are not work keeping. I now want to changes branches, but git gives me,
error: You have local changes to "X"; cannot switch branches.
I thought that I could change branches without committing? If so how can I set this up. If not, how do I get out of this problem? I want to ignore the minor changes without committing and just changes branches!
Cheers,
Dan