You need to flash the stock firmware through Odin.
Go to sammobile.com, find the suitable Odin programme, ops file, flash guide and the firmware file for your region for your particular phone model and flash it.
It should revert your phone back to stock samsung software.
Samsung GT-S5830 Galaxy Ace
ROM: AOKP 4.2.2
Scripts: CronMod INT2EXT4+
245MHz - 800MHz, SmartassH3