I create a new branch dark and add a new file y.js. Then I switch back to the main branch. Why is y.js not lost when I switch branches?
Asked
Active
Viewed 28 times
-2
jonrsharpe
- 107,083
- 22
- 201
- 376
Durfingo005
- 5
- 1
-
1Because uncommitted changes are not _on_ any branch, they're not part of a commit. – jonrsharpe May 19 '22 at 23:04
-
1https://stackoverflow.com/questions/67450004/git-checkout-branch-after-git-add-seems-not-update-index-and-working-area – matt May 19 '22 at 23:22