how do I retrieve deleted messages from my mac

I accidentally deleted messages from my mac but it still shows up on my iPhone
You cannot retrieve deleted messages unless those messages were part of a backup, but if you restore that backup, you will restore only the messages you had at that time. Any subsequent messages will be lost. Being that those messages are still available on your iPhone, take solace in it.

Original thread: https://forums.imore.com/threads/how-do-i-retrieve-deleted-messages-from-my-mac.383061/