Problems with Apple Photos
I can't guess what corrupted the files or the database, but Time Machine would allow you to roll back whatever corruption or changes you don't like and get back to a point in time.

To do that, open Time Machine and restore the library file / overwriting the wrong version.