7

I accidentally hit Git clean command in Visual Studio code, and I lost all my files. Is there any way to recover my files? Tried to find files with recovery programs, but no results.

Matija Lukic
  • 121
  • 2
  • 9

2 Answers2

3

Unfortunately, no, those files are gone. AFIK Git doesn't create any backup copyies.

According to the source code of the clean command it executes unlink when you hit this command.

neshkeev
  • 6,280
  • 3
  • 26
  • 47
0

This answer here (https://stackoverflow.com/a/24673982/2441655) suggests that running git fsck --lost-found may recover some files.

Community
  • 1
  • 1
Venryx
  • 15,624
  • 10
  • 70
  • 96