'Visual Studio Code Destroyed all my files

I have been using visual studio code for about a year now. Recently I went to save one of my files and visual studio code gave me the error message this file conflict with a previous version. I clicked on the error and it presented me with a screen show the differences. I turned out I had added a line at the top importing defining a new constant. When I clicked override visual studio code presented me with a blank file. I went to look at my files and found that every file I have every worked on in the program has been changed to a blank file. Now whenever I try to save a file nothing happens, and I can't close tabs. I use a macbook if that helps in any way. Does anyone know how I could retrieve my files and how to prevent this prom happening again.

Edit: this applies to all my files not just ones associated with this project.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source