I fear I already know the answer but here goes anyway.. I accidentally clicked "Discard All Changes" in VS Code (OSX) and now a month's worth of work is gone. Poof'd. Thing is, I didn't have GIT properly setup so I hadn't done any commits yet. Is there anyway I can get my work back? Right now my working directory is as good as empty..
[edit] I should clarify, the console log says it did a "git clean -f -q" which would mean the files are gone. But I was wondering if VSCode maybe has a backup or history or cache.. or anything. I'm desperate..
Ctrl + Z or restore from trash. I have lost work to this multiple times, and to remedy this, I commit all the changes, then reset the branch to the previous commit.
Click the (...) button and then select Undo Last Commit to undo the previous commit. The changes are added to the Staged Changes section.
After accidently pressed discard changes btn on the wrong file, and I ended up here) Having not found the way to restore, I have tried simple CMD+Z (CTRL+Z) in that file, and boom - everything is back, so dont give up and try that :) Very pleased
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With