We need details
What version of the OS do you have? How exactly did yo delete the "optimized" photos? What iCloud Service(s) are you using? If you are using iCloud Photo Library then all deletions are synced to all devices adn you need to recover your photos from the recently deleted album within 30 days or they will be gone
LN