I’m on local branch A and did some changes without committing (they are not done). Then I want to create a new branch B (to work on something different) without bringing in the changes in branch A. If I do ‘git checkout -b B’, the changes in branch A will be brought to the new branch B. How can I avoid this? I want a brand new branch B without the changes in branch A, and I don’t want to commit the changes in A at this moment because they are not finished.
Thanks guys!
You can stash your changes before checking out a new branch.
If you have some new untracked files and you want them gone too, you can first add them (but not commit):
Later you will be able to untrack them by