Hello
Do you have a backup of text messages on your computer? Or have you exported your text messages from your phone to computer? If yes, then the text message will be kept on your computer even if you have reset your phone to factory settings. If you don’t have a backup or you have not transferred messages to your PC, then you’ll lose the messages data.