Recovering Deleted Files on macOS After Terminal Deletion
There may still be a way to recover the files.
Since they were deleted using Terminal and do not appear in the Trash, the first step should be to avoid making further changes to the Mac's internal storage.
In particular, do not erase the disk or reinstall macOS until we know what happened.
You mentioned that, after restarting, the Mac displayed the macOS setup process.
That fact alone does not establish whether the deleted files are still present or whether the disk was erased. The exact Terminal command you used is therefore very important.
Apple's macOS Recovery provides access to Disk Utility and Terminal, as well as options for restoring from a Time Machine backup. Apple: Use macOS Recovery on a Mac with Apple silicon
If you have a Time Machine backup, Apple provides procedures for restoring your files from that backup, including restoring your user account and personal files. Apple: Restore your Mac from a backup (Apple Support)
For now, the safest next step is to start macOS Recovery and inspect the available storage without erasing anything.
Apple explains how to start Recovery on both Apple-silicon and Intel Macs here: Apple: How to start up from macOS Recovery(Apple Support)
Once in Recovery, do not select any option to erase the disk. Terminal is available from the Recovery environment. We can use it to inspect the storage with commands such as:
diskutil list
and:
diskutil apfs list
These commands will help determine what disks, volumes, and APFS containers are currently visible.
At this stage, we should avoid commands that modify the storage.
The most useful information you can provide next is the exact Terminal command you used, even if you only remember part of it.
Also tell me whether the Mac is still at the initial setup screen and whether you have a Time Machine backup.
With that information, we can determine the next step without making assumptions about what happened to the files.