Search code examples
gitmacosvisual-studio-coderecovery

VS code Delete my Unity project (OS X)(git clean all)


I don't use git but Visual Studio Code has a git icon. So I clicked 'clean all' then my unity project has been deleted.

How can I get my project back?

I'm using OS X.


Solution

  • You can't get it back using git or Visual Studio Code. May be OSX can help you to restore the files (for example via Time Machine).

    Short explanation of what you have done:

    • You opened a folder (which was not a git repository).
    • You clicked on the git icon in the menu bar on the left side
    • As the opened directory wasn't a git repository there was only the option "Init git repository" that you clicked on.
    • A list of files appeared and they were all unstaged (that means they weren't already part of the source control)
    • You clicked in the menu on Clean all.
    • A message box appeared displaying the text:

      Are you sure you want to clean all changes?
      
      This action is irreversible!
      
      There are unstaged changes in X files.
      
    • You submitted the message box by hitting "Clean Changes". That deleted all the files in the folder.