0

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)?

Francis Ting
  • 671
  • 6
  • 15

1 Answers1

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