The best way to prevent the deletion of photos from your Canon camera is to regularly back up your photos to an external storage device or cloud storage service.