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.
请先登录再写评论。
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.
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.
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?
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
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?
Dmitry Tronin To be fair, that is not at all a sufficient notification for an action that can have major implications. It is not clear anywhere on this program that deleting files, otherwise available through the computers folder manager, will be permanent and completely unrecoverable. In fact, I had opened a project for the first time and I hit delete on the single folder because I wanted to start fresh. I thought it was a button pointing to the directory, not the directory itself.
Yes it was a dumb mistake. But its unacceptable that I was able to irreversible delete 20GB of school projects in 2 clicks.
Please don't back up this implementation by saying 'to be fair.' Its a poor design choice and should either A) have a more blatant warning, or B) have a clear explanation of how deleting works in this program. I lost a lot of school work (which was an extremely expansion process, both in time and money), so its a pretty awful thing for an employee of this company to say in response to this reasonable question.