I know that many tools to recover deleted photos from an SD card exist, but does one also recover the original photo ID, like
The last time I used Photorec to recover deleted photos from an SD card, it successfully restored the filenames of all my recovered photos.
The Photorec FAQ says that it can sometimes recover filenames from FAT-type filesystems, and also if the filename was embedded in the file itself.
Of course, this is no guarantee of success for your individual case.
The programs that don’t recover filenames are searching the disk at a low level for signatures and headers (tell-tale patterns of bytes) of various file-types (similar to how antivirus programs detect viruses).
What you need is an “undelete tool” as opposed to a general data-recovery program.
Recuva (figure 1) is a popular program and has an option to do both a “deep-scan” (search for file-types) but also a normal scan that simply checks the file-system (where the folder- and filenames are stored).
Personally, I like Undelete360 (figure 2). It too has deep and “shallow” scan options, but last year when I had to recover ~9,000 accidentally deleted graphics files, it really impressed me with its results.
Both are free.
Figure 2: Undelete 360