I decided to make git repository with Visual Studio and added version control using VS tools. I have never do that, so I thought I should make repository myself and VS will only make .git and add some gitignore lines.
My project contained some files which are dangerous to keep public but when git was initialized in VS there was first commit including my file.
git init
. I saw Reinitialized existing Git repository in D:/Projects/Programing projects/C C++/QT/SushiWokAdmin/MY_GREAT_PROJECT_I_WAS_MAKING_IT_FOR SEVERAL_WEEKS/.git/
.I have not done any commits nor pushes. How can I restore my files?
P.S: I still have .vs folder with some files in it, can this help me to restore my project?
Running git-init
didn't delete your files.
Running
git init
in an existing repository is safe. It will not overwrite things that are already there. The primary reason for rerunninggit init
is to pick up newly added templates.
Your files might still be there in the repo.
You can try:
git restore :/
git reset --hard
git log --graph --all --oneline
)