You have 2 options here. You can attempt a Dirty Flash with the risk of it being buggy as a result, or you can back up your data using TWRP, wipe the necessary things you usually wipe for installing a fresh ROM (or just use the factory reset option in TWRP), flash the ROM and then DON'T RESTART...