Pergunta

Here is my problem:

  1. After doing some changes in my project, I executed git stash, but I did not execute git add . before.
  2. I then removed one folder I was working in before doing git stash.
  3. Finally, when I wanted to pop the changes I found that the folder was not there.

What happened? Is there any solution?

Thanks again.

Foi útil?

Solução

From man git stash:

git-stash - Stash the changes in a dirty working directory away

If there were untracked files (files you never "git added" to the repo), then they will not be stashed. So if you deleted the folder, you lost your work.

For the next time, you can consider using git stash --include-untracked (see man git stash).

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top