0

I just cleaned a file while exploring cleaning option in git. How can i get that file back ?

I used below command: git clean path/file_01.py -i

Then i selected: 4: ask each

Finally, presseed 'y' instead 'N' yes

JayadevBS
  • 23
  • 7
  • The file is deleted, and by definition of `clean`, it is not tracked by `git`. Look for general guides on how to undelete files on your OS, this has nothing to do with `git` any more. – Amadan Jul 12 '18 at 03:20

1 Answers1

0

git clean only removes files that aren't tracked by git in the first place, so there's no git-trick that can recover such a file once it's gone.

Mureinik
  • 297,002
  • 52
  • 306
  • 350
  • Are they files deleted from disk as well ? Can i get those in local repo or recycle bin ? – JayadevBS Jul 13 '18 at 04:48
  • @JayadevBS `git clean` will delete files from the disk. Whether or not they remain in your recycle bin is up to the OS you're using. I just test with Git Bash on Windows 10, they do not. – Mureinik Jul 13 '18 at 06:49