Did you change it from POP to IMAP or IMAP to POP. With POP, the emails are downloaded to the device/computer and are off the server, where as IMAP stays on the server.
Did you reset the configuration to see if they're still there but the iPhone cannot see them? It might be that your email provider does not provide IMAP and so setting it to IMAP means its not getting the emails, i.e., not seeing them.
Finally, this question is best asked of your email host, I'd reach out to them on getting your emails back