Some files disappeared after Git Stash

I am working on a directory. I have made some changes since my last commit. And I want to ignore all these changes (which are after my last commit). In the near future I want to return my last commit. I accidentally executed the wrong command, and I executed this:

git stash Saved working directory and index state WIP on master: 46dbc13 Ayarlar activity geri butonu HEAD is now at 46dbc13 Ayarlar activity geri butonu 

After that, most of my files (all my image files) disappeared. But they existed in my last commit (# 46dbc13). They are deleted after my cache. I have no idea. I performed git stash apply , but nothing has changed.

Can you tell me what is going on?

+4
source share
2 answers

git stash is a mechanism to postpone changes. I see that it is used most often when you are in the middle of writing new functions, but should switch to something of a higher priority.

If you want to see a list of your stamps, you can go with git stash list and see something similar to the following:

 git stash list stash@ {0}: WIP on master: 46dbc13 Ayarlar activity geri butonu 

If you want to apply your changes, you will either have to go with one of the following two commands:

Pop : this will pull the top line from your stack

 git stash pop 

Apply: This will apply the specified case. If your git stash list has only one cache (as mentioned above), you can use this. If you have several delays, you need to apply the specific print run that you want to apply.

 git stash apply stash@ {0} 
+2
source

I found the answer at the same time with @kostix.

 git reset --hard 46dbc13 

solved my problem. I found this command here: fooobar.com/questions/67 / ...

+1
source

Source: https://habr.com/ru/post/1486812/


All Articles