Chosen Solution
My mobile battery was not working properly and so I have took the battery out from the mobile after a month I switched it on and it’s telling to sign in Samsung account I have reset my password and after opening I found that all of my data had been erased. Some of them are very important how can I get them back. ( how to restore factory data reset )
If it reset, I don’t think you can. But if you have an sd card in it, you might be able to take it out and try it on a different phone.