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..
解决方案
Since Clean All (discard all changes) option in VS code essentially execute
git clean -fd
git checkout -- .
So it’s the business for git that if git clean -fd can undo discarding uncommitted changes.
Unfortunately the changes are not stored in git since it not committed, so after this command executed, git will clean untracked files by force.
After after execute the command git checkout -- ., git will checkout all the modified files in git as the version of last commit.