1

If I have two branches, "master" and "secret_feature", if I add a bunch of text to the master branch (but don't commit), and then close the window, then go to the command line and type "git checkout secret_feature" if I then go to the same file after this checkout, the same text is still there.

Do I need to commit it or something? Why is it preserving it?

Doug Smith
  • 29,668
  • 57
  • 204
  • 388
  • https://stackoverflow.com/questions/246275/modified-files-in-a-git-branch-are-spilling-over-into-another-branch – phd Nov 14 '18 at 15:27

1 Answers1

0

Before change a branch you can stash your changes. When you get back to master branch you do git stash pop and your changes will be in your working directory.

Tomasz
  • 29
  • 5