If you are flashed all sorts of hacks on your ATT branded Samsung Galaxy Mega 5.8 smartphone and want to get back to stock firmware, you might want to flash its official firmware I527UCUBNE7. This method will remove root from Galaxy Mega 5.8 and also remove custom recovery and whatnot. This package must be flash using ODIN. It has multiple parts.
AP: Get the file from here and flash it under PDA in ODIN. It is a huge file and it contains system, stock recovery and kernel partition. Download it from here.
BL: This is the bootloader. If you already took the update ignore this but if you want to upgrade your phone you must flash this Download
CP: This is the modem and other network related partitions. You must flash this under Phone in odin Download
CSC: This contains carrier related settings for our firmare. Flash this under CSC in odin. Download