When you sign into an iPhone using a different account, the phone asks if you wish to save the data on the phone. If you say "yes", the data then get merged with the other person's iCloud data and their data end up on your phone. If the other person said "no" then your data were deleted on the phone and your friends data were put on it. When you signed back in, your data should have reappeard, but that is only if you were using iCloud to store your data too, otherwise they are gone for good unless you had a computer backup.
You should never let another person sign in on your iPhone unless they are doing so in a web browser or an app that specifically allows it. If this had been a stranger there would have been the risk they might have held your phone at ransom. Once a person signs in on a phone, the phone's database says that the phone now belongs to that person and it requires their ID and password to remove the ID.