If you want to recover a text message, tap on the thread or message so that it's selected, hit Recover on the bottom right, ...
As someone who uses the Notes app across all my Apple devices, I can imagine how scary it might be to suddenly lose access to all of my notes. It actually happened to me a few macOS beta releases ago.
Whether it was a sweet message from a loved one or an important piece of info, the panic that follows can feel real. But ...