1

I accidentally issued:

git clean -f

On a directory I recently initialized. I noticed that all my text files in that directory are now gone.

As per research, I've come to known that it's irreversible. Is that true? Or there's still hope?

BTW, I'm using a Mac, you guys might give me an idea on what free data recovery software are available for Mac.

It was a dumb Git newbie mistake.

nickhar
  • 19,981
  • 12
  • 60
  • 73
Panoy
  • 173
  • 1
  • 3
  • 11
  • Sorry, your directory is gone. Unless you're running git on some external server that keeps backups. If it was local, and you have no backup software available, I'm afraid you might be out of luck. – Jon Nov 27 '12 at 15:33
  • Also, see http://stackoverflow.com/questions/8346563 for more information as to "why" – Jon Nov 27 '12 at 15:34
  • So how come it doesn't go to the Trash folder? It would be nice if they were deleted temporarily and not permanently. Bummer – Panoy Nov 27 '12 at 16:59

1 Answers1

1

Yes, your data is gone.

git clean -f deletes all untracked files. Since you've just initialized your repo, all your files were untracked, so they're all gone. That's why they make you use a -f flag: to avoid accidental data loss.

If you're on a Mac, then maybe you have Time Machine activated? That should help you.

mgarciaisaia
  • 14,521
  • 8
  • 57
  • 81