If you meant that you want to recover deleted text messages from your iPhone, I had experienced once.
As a matter of fact, every time you sync data between iPhone and iTunes, all previous data will be automatically backed up by iTunes and stored as a .sqlitedb file, which will be updated along with the later sync continuously.
But those backup files can't be viewed or taken out unless you use some software using special algorithms to extract. A third party specific iPhone data recovery software called Tenorshare iTunes Data Recovery can help. I used it and got my messages back. By the way, you can download it form http://www.any-data-recovery.com/product/itunes-data-recovery.htm