First: To reset the device first do the backup what ever you need.
Second: this could make your phone able to flashboot and reflash again:
You can send intent MASTER_CLEAR in adb:
adb shell am broadcast -a android.intent.action.MASTER_CLEAR
or as root
adb shell "su -c 'am broadcast -a android.intent.action.MASTER_CLEAR'"
C:\Flashtool\x10flasher_lib>adb shell
shell@E2303:/ $ am broadcast -a android.intent.action.MASTER_CLEAR
am broadcast -a android.intent.action.MASTER_CLEAR
Broadcasting: Intent { act=android.intent.action.MASTER_CLEAR }
Broadcast completed: result=0
shell@E2303:/ $