Hi ani-chan, we are sorry to hear that this shouldn't have happened to you.
However, if you have synced data to your Samsung Cloud account, your files and data will be uploaded to the cloud server for safe keeping. Restore backup data from Samsung Cloud; please perform the following:
•From Settings, tap Accounts and backup, and then tap Backup and restore. Tap Restore data, select your desired device, and then select the content you want to restore. Next, tap Restore. If needed, follow the on-screen instructions to download your backup data.
Google is a great option to back up and restore your data.
Open Settings, and then tap Accounts and backup. Tap Backup and restore, and then tap the switch next to Back up my data under Google account. If prompted, sign in using your Google account credentials. Your data will be automatically backed up to your Google Drive.
You can also back up manually by tapping Google Account, and then tapping Back up now.
To restore your data, tap the switch next to Automatic restore under Google account.