Question: how to backup whatsapp messages after deleting?
Answer: Uninstall WhatsApp from your Android smartphone or iPhone.
Reinstall WhatsApp and set it up with your phone number.
Once the app is set up, you will get a prompt asking you to restore messages from a cloud backup. ... 
This will bring back the messages that you had accidentally deleted.