Hey everyone, I made a pretty big mistake while using Git and ran the command 'git clean -f -d', thinking it would only clear out some branch data, but it ended up deleting a ton of files from my home folder. I realized what happened almost immediately and tried to stop it, but then I mistakenly rebooted my system, which has now become non-functional. I need to reinstall the OS, but I'm hoping to recover some of the lost data first.
I've heard that live booting with an SD card or USB might help me back up my current data and possibly recover the deleted files, but I'm unsure if it'll automatically mount the SSD and overwrite data, which would further jeopardize my recovery chances. Is there a way to make sure the live system is read-only before attempting any recovery? By the way, this mishap occurred on a Steam Deck, which complicates things since it has an SSD. Thanks for any help!
3 Answers
First things first, don't boot into your normal OS! You should definitely start by booting from a live CD or live USB. When you do that with a Debian live USB, it should ask before mounting any disks, which is good news. To access your SSD in read-only mode, you can manually mount it as read-only after booting up. Just make sure to use the 'mount -o ro' command when you mount the filesystem—this will help keep your data safe while you make a backup. Also, remember to create an image of your filesystem to preserve anything that’s still recoverable without touching the original data.
Just to clarify, I think the process you followed to create the Debian Live USB was spot on. EtchDroid is a solid choice for making USB bootable. Once you're in the BIOS, change the boot order to prioritize your USB device. If you’re unsure about doing a live boot, it's totally okay to ask; it can be a bit confusing the first time! Just ensure that when you're booting up, you're only accessing the files you need for recovery.
You should be alright with a Live USB; it typically doesn’t mount local disks by default, especially when you’re testing the setup before installing. If you're concerned, just check the mount options before proceeding. You're on the right track with getting the KDE live version installed. After you boot, go to the BIOS settings to ensure that your USB loads first, and hopefully, that should get you started without writing anything back to the SSD.

Related Questions
Can't Load PhpMyadmin On After Server Update
Redirect www to non-www in Apache Conf
How To Check If Your SSL Cert Is SHA 1
Windows TrackPad Gestures