I accidentally deleted my .git folder after stashing major changes. I cannot recover my folder or my stashes. Is there any way I could recover the stashes from the server end(I am using bitbucket)?
Asked
Active
Viewed 146 times
0
-
2No. Stashes do not get pushed. See: https://stackoverflow.com/questions/1550378/is-it-possible-to-push-a-git-stash-to-a-remote-repository – Jan Wirth May 30 '18 at 12:14
-
Thanks..Guess am doomed for this one :( – Francis Ting May 30 '18 at 12:21
-
1I'm sorry. You'll have to redo that. But often that's a valuable experience. I can write a song about the many times that git happens :D – Jan Wirth May 30 '18 at 12:22
1 Answers
3
The stashes
is stored in ./.git/refs/stash
while older ones are in the reflog of that ref in same directory
.
So, you cannot get those stashed changes back
Here is the documentation:
Use git stash when you want to record the current state of the working directory and the index, but want to go back to a clean working directory. The command saves your
local modifications
away and reverts the working directory to match the HEAD commit.
It clearly mentions the local modifications
so they are not even pushed.
You either need to restore that .git
folder using some ways
or you need do do them again

Sravan
- 18,467
- 3
- 30
- 54