2

I was removing the flutter project old git branch, commits, remote origin. While applying the command for untracked files I accidentally typed some commands which removed all my work including the files and folder of the project, now my project is empty, I am lost.

Please, is there any way to undo all the commands which I have applied and recover my files and folder in VS Code?

I have just remained with these files in my project folder

enter image description here

git log output: enter image description here

Arty-chan
  • 2,572
  • 1
  • 19
  • 25

1 Answers1

0

the same files I have mentioned above are committed to Github

The straightforward solution would be to:

  • close VSCode
  • rename your folder where those files are missing
  • clone again your GitHub repository
  • reopen VSCode
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • sir the same files above mean, only the files in screenshots. All my files and folder of the project have gone away without going to recycle bin, and previously,I have not uploaded the project to Github – navidanchitrali Jan 07 '22 at 08:40
  • @navidanchitrali yes, but you have committed them locally, yes? Check `git log` (in command-line, in the root folder of your local Git repository) to check if you see your commit (before the changes done by Git with VSCode) – VonC Jan 07 '22 at 09:07
  • sir I have attached the git log output in the question above, what to do next? – navidanchitrali Jan 07 '22 at 09:56
  • @navidanchitrali If that commit was done *before* loosing your changes: `git restore -- .` – VonC Jan 07 '22 at 11:07