Reflash TWRP, make a backup of your data. Then format data, flash the new ROM, reboot and go through first time setup, setting whatever screen protection (pin, pattern) you had before. Then, in TWRP, restore the backup
4 Likes