The files disappeared because the Command + Z shortcut undid the previous pasting command. You can get back the files by redoing the undo command. Just navigate to the directory where the folder was located and press Shift + Command + Z.
If that doesn't help, try recovering the deleted files from your SD card using a trustworthy data recovery tool like iBoysoft Data Recovery for Mac. It can retrieve the deleted files as long as they are still physically present on the SD card, which means they are not overwritten by new data.
If you have already saved some files to the SD card, there's less chance to restore all the deleted files. Still, you should give it a try to see if your files can be recovered, as this software allows you to preview the found files for free.
Follow the steps below to recover the deleted files on the SD card:
Step 1: Free download and install iBoysoft Data Recovery for Mac.
Step 2: Connect the SD card to your Mac.
Step 3: Open the recovery software, select your SD card and click "Search for Lost Data."
Step 4: Preview the found files.
Step 5: Tick the checkboxes next to the files you want to restore, then tap the Recover button and save them to a storage location. Avoid storing the recovered files on your SD card to prevent overwriting and corruption.
And, yes, the Command + Z shortcut won't give you any notification about the consequences, so you need to be more careful next time.
[Complete Guide]How to Recover Deleted Photos from SD Card