I don't really understand git stash
. According to the documentation, I may use stash
to save my current repository state in the same say as if I backup/restore my repository somewhere.
Apparently what I did was something else...
I first wanted to completely save my work, even though the untracked files. So I did:
git stash -u
Then I did some not very important work. At the end I wanted to come back to my original work so I used this command:
git stash pop
The weird thing is that I got this message:
Auto-merging foo.c
CONFLICT (content): Merge conflict in foo.c
And inside my file I got this
++<<<<<<< Updated upstream
++=======
+ // something
+
++>>>>>>> Stashed changes
Actually, instead of using stash I could have used:
cp -R myproject myproject_backup
And later restore my work:
rm myproject && mv myproject_backup myproject
What did I misunderstand?