OK-- but use a backup of your Library. Messing around in the Library Package can render the database unusable.
The Photos Library, usually named Photos Library.photoslibrary, is usually found in the Pictures folder. The Library is a "package," a folder that is slightly protected-- it takes an extra step to open it and look inside. You can open a Library package by right-clicking the Library and choosing Show Library Contents. The insides might look like this:

The folders might be different depending on the OS, and there may be extra folders and files, but Ventura and Sonoma look about like this.
The "Originals" folder has the original picture files, but their names have all been changed. Since there might be several pictures named IMG_0123, for instance, all the file names have been changed to a 128 bit name like 39B2CD17-CDCF-4412-823F-6D48938D3D0E.jpg This is a GUID, a 128 bit global unique identifier. With 128 bits, there are 10³⁸ different possible names, so a random number generator is very very very (38 verys) unlikely to produce a duplicate name. Pretty cool.
So, you can retrieve all your Original Unmodified picture files, but you may have a time trying to get them into order. The metadata should be intact, though, so the dates will help a lot. But the dates in Finder are file dates, so they may mix up capture dates--you may not be able to rely on Finder dates for help.
I just tried this, and I imported the pictures from an Originals folder into Photos, and Photos correctly interpreted the capture date from the pictures' metadata. So pictures of similar events occurred together. So there may be no need at all for the original file name!
The Recources folder has Thumbnails and preview copies, all lower resolution than the originals. But if you did have some edits, these might show a bit of what was done. These do not have the comments, keywords, captions or titles that may have been added.