DEV Community

Discussion on: git reflog saved my ass.

Collapse
 
leanminmachine profile image
leanminmachine

? how does it work if the changes arent committed or stashed somewhere..?

Collapse
 
oligospermia profile image
Mesalazine

Well changes should be in the stash of course. Then you accidentally lose it (via git stash clear or git stash drop). However, even if changes weren't committed, they still do have some hash tags in the repository, they are stored as so called "dangled commits". So all you have to do is find such hash and apply it via stash command to restore. You can see an example here:

stackoverflow.com/questions/89332/...

Thread Thread
 
leanminmachine profile image
leanminmachine

nice, thanks for the link!