Restore deleted .git folder

Hello,

 

I accidentally misclicked and deleted a whole folder instead of one single file. That folder contained my .git folder. I used ctrl-z to undo the delete, but it does not appear to have restored my .git folder. How do I get back my .git folder? It does not appear in the local history. 

5 comments
Comment actions Permalink

I am afraid you can't. We don't index the .git folder because its contents are mostly binary, so there's no way to go back.

0
Comment actions Permalink

Thank you for the response. Fortunately I did not have much work that I hadn't pushed remotely, but I hope you can see how devastating this could have been - I would not expect a product such as PHPstorm to be able to do something so damaging and irreversible with a simple misclick. 

1
Comment actions Permalink

It wouldn't be a crazy idea to use the system trash when available. Just earlier today I hit myself the Del key on the wrong files in some other piece of software and Windows recycle bin saved me.

I was expecting to find a ticket in the issue tracker but I couldn't find one. Is it possible that nobody has suggested it yet?

1
Comment actions Permalink

To be fair IDE is trying to protect you from bad decisions by showing "Are you sure?" prompt when user is trying to delete a folder or a file:

 

@Álvaro González we're using our own filesystem & there are no plans to integrate it with a system(s) trash

0
Comment actions Permalink

That's fair, I was trying to delete a file so I just clicked through without reading, assuming it was warning me about deleting a file. Really whenever I delete a file I just click through the pop-up. Crying wolf and all that. Maybe it would be better if there was a special warning if you try to delete non-indexed files? 

0

Please sign in to leave a comment.