I\'ve been searching around here for to look for an answer and it seems I may just be making incorrect assumptions on how git branches are supposed to work.
I have my
It sounds like you created the branch with git branch profiles
, but didn't switch to it, so you stayed in master
, and it got the file changes when you did a commit.
After creating the branch, you need to explicitly switch to it with git checkout
(just create new branch on-the-fly and switch to it in one step using git checkout -b
).
If you have changes you don't want to lose (or commit to the current branch), but instead put into the other branch, do:
git add -A
git stash
git checkout
git stash pop
More info on git stash
is available from git-scm.com