Write the current state. If you have root and the flash counter is up - use Triangle Away and flash stock rom after that. But if you are on KNOX bootloader - if KNOX is triggered to 0x1 - there's nothing you can do about so far to revert to stock 0x0 . If KNOX is 0x0 - you have to flash same version of the stock rom.
If not on KNOX bootloader - just do the first 2 steps, but flash with 4.2.2 rom without KNOX.
I have same issue - my rom is stock with root and knox 0x0 and have no guts to flash it back to stock + Triangle Away, so everything is on your own risk.