I was working on a git branch and was ready to commit my changes, so I made a commit with a useful commit message. I then absentmindedly made minor changes to the code that are not worth keeping. I now want to change branches, but git gives me,
error: You have local changes to "X"; cannot switch branches.
Can I 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 change branches.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…