If you are using Mojave, and probably High Sierra, past text messages are stored here:
~/Library/Containers/com.apple.iChat/Data/Library/Messages/Archive
Click on your Desktop to get Finders attention, and then press shift+command+G to open a Go To Folder dialog. Copy and paste the preceding link into it and press GO.
In the Archive folder, the text messages are organized into ascending order ISO8601 date stamped folders (e.g. 2018-05-12) that reflect the text date. The individual texts are stored in Apple binary plists with a name like:
Jon Jones on 2018-05-12 at 13.12.00.ichat
When in the Time Machine Restore panel, you can also utilize the shift+command+G technique, paste in the long folder path above, and land within the Archive folder. Move backwards in backup timeframe until you locate the folder bearing the date stamp of your deleted text, and select the specific text item that you want to restore.