I'm afraid you've fallen out of Git's "mercy" by not adding these changes to
the index, or stashing them. Local changes are not specific for any branch,
so to speak. They don't "stick" to the branch you're in before you commit.
By adding your files to the index, Git will not overwrite them anymore when
you do a checkout:
git add -A
Alternatively, you can stash the changes:
git stash save "some changes"
This will remove the changes while storing them in a stash that you can
recover later on with "git stash pop". See "git stash help" for more info.
Now, this being said, I want to come back to your original problem: Doing
"git checkout master" (switching to a branch) will not overwrite any
changes, as far as I can see. Also a pull will refuse to overwrite local
Therefore I think you might be forgetting one step you did after switching
to master. Did you do something like "git checkout ." or "git clean"?
You received this message because you are subscribed to the Google Groups "Git
for human beings" group.
To post to this group, send email to email@example.com.
To unsubscribe from this group, send email to
For more options, visit this group at