Assume you delete the certificate by mistake
certbot delete --cert-name www.domain.com
Trying to add back the domain doesn't work anymore with the following error
emerg BIO_new_file("/etc/letsencrypt/live/www.mydomain.com/fullchain.pem") failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/etc/letsencrypt/live/www.mydomain.com/fullchain.pem','r') error:2006D080:BIO routines:BIO_new_file:no such file)
sudo certbot --nginx -d www.mydomain.com
Find the nginx configuration file for your domain at /etc/nginx/sites-available
and remove all line with # managed by Certbot
.
Check for nginx configuration error and reload nginx.
sudo nginx -tsudo nginx -s reload
Try to add the domain again.
sudo certbot --nginx -d www.mydomain.com