Yes, you can do what Mali2 told above or after formating the data partition, connect it to PC and move the ROM again. I always flash the rom first and then I Wipe data. This way I have the rom in the phone's memory before wipping. OTG is a great help in this cases