You can recover deleted photos from an SD card on a Nikon camera using the data recovery tool Disk Drill:
Download and install Disk Drill.
Connect the Nikon camera’s SD card to your computer.
Scan the SD card for any deleted photos or videos.
Preview and select the photos and videos you want to recover from the SD card.
Recover the photos to a separate storage device.