Deleted all my files in the terminal with ”rm clean -f -d”

Would there be a way for me to retrieve my Home folder and all the files that were in it?


I was using Git for a project and was trying to transfer over my current work onto Github. I didn't know until after, but I accidentally initialized a repository on my Home folder. Then, while in the terminal, I used, ”git status” and it gave me a result of a list of files that we're marked red. Not crossing my mind, I looked up how to delete those files and found, ”rm clean -f -d” which I thought would only clear that status. Apparently, after executing the command it was loading a bunch of files inside the terminal and after it was complete. It was at that moment where I realized that I just wiped all of my folders and files and can't get them back.


The aftermath. I was logged out of my Apple ID. When I re-input the correct user name a password, it gives me a prompt message of:


”Keychain ’login’ cannot be found to store ’email@gmail.com’ -- ”Your keychain may have been removed, deleted, or it's on a unmounted volume”


It then gives me the option to, cancel, or Reset to Default. When I click on Reset to Default, it doesn't do anything.


How would I be able to retrieve my files/folder and sign back onto my MacBook using the Apple ID?

MacBook Pro 15", macOS 10.15

Posted on Jan 21, 2020 4:06 PM

Reply
Question marked as Top-ranking reply

Posted on Jan 21, 2020 4:12 PM


I realized that I just wiped all of my folders and files and can't get them back.



You can restore from your backups.


Boot clone https://discussions.apple.com/docs/DOC-10081


How to use Time Machine to restore your Mac: https://support.apple.com/en-us/HT201250


2 replies

Jan 21, 2020 5:25 PM in response to ghostcat88

Just take note how hard it is to recover from a rm -r. My manager was the only one available who knew how to recover from our tape backups, and he let me know for the next week. I had to bribe him with food for the next week.


There might be unerase utilities you might be able use. Any kind of deletion command doesn't really do anything other than clear the directory info - at least initially. However, the longer you use it, the higher the chance that your data could be overwritten or absolutely wiped. Especially if it's an SSD with TRIM enabled.


Maybe if you've got another Mac that you could use to access it in Target Disk Mode?

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Deleted all my files in the terminal with ”rm clean -f -d”

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.