I don't run random commands, so not going to particularly analyze what you typed in, but will say that the script included with User Scripts that does the same thing is this:
find /mnt/user -maxdepth 9999 -noleaf -type f -name ".DS_Store" -exec rm "{}" \;
As far as recovering, you can pull the drive and attach it to your Mac and then install and run (and unfortunately pay for) https://www.ufsexplorer.com/ufs-explorer-standard-recovery.php (I've run this on Windows and it works great (albeit I used it for a different reason) )