How to revert rm -rf in Mac OS X?
Andrew Henderson
I was trying to run a set of commands (all starting with rm -rf) to completely remove an application in Mac OS X. All my folders in Desktop are accidentally removed somehow. Is there a way to bring them back?
1 Answer
You can use PhotoRec but keep your expectations low, it's pretty unlikely that you would get back your data after an rm -rf operation. You can usebrew to install PhotoRec, it's part of testdisk (brew install testdisk).
If the files lost were on your Desktop, you may want to check on iCloud. By default Desktop and Documents files sync to iCloud Drive and most people don't deactivate that setting.