How to reset your Android system folder I've done some messing around with root and I want to just restore my galaxy s4 to how it was when I first got it. I've done "factory resets" but all it does is wipe data. I need to restore my system to get everything back in order. It's not that I want to get back to jellybean or anything, although that would be fine, I just want to ACTUALLY factory reset and not just wipe data. I need to do this to upgrade to lollipop and I don't want to flash software. Thanks so much
You must be referring to a firmware reflash. Keep in mind that this is a dangerous process if you're not sure what you're doing; so if you do choose to continue, follow these instructions to the letter. Oh, and I'm assuming you're using Windows.


Download Odin from here, and install the Samsung ODIN drivers from here.
Type *#1234# in your phone dialer and take note of the CSC value. If SuperSU appears instead, reboot to stock recovery and take note of the CSC value. If you're using a custom recovery, you should now try to recall where you bought your S4 and whether you bought it unlocked or not.
Now that you have your phone's region, head over to SamMobile and search for your phone's model number. When the list of available firmwares appears, look for the listing that matches your CSC or whatever info you have about your phone's place of purchase.
Download the firmware once you've found it. If the download comes as a ZIP or a RAR, extract it so you're left with a .tar.md5 file.
Switch your phone completely off. Now, press and hold Home + Volume Down + Power and hit Volume Up when your phone asks you if you're sure.


Here comes the part where you should really be praying that nothing bad happens. Any mistake from here might turn your phone into a nice expensive doorstop!


Open Odin. Click the AP button if you downloaded Odin 3.09+, or the PDA button otherwise. Now, browse to and select the .tar.md5 file you downloaded.
Open up Task Manager (Ctrl + Shift + Esc) and make sure no processes related to Samsung Kies, such as Kies.exe or KiesTrayAgent.exe, are running. Close them as necessary.
Uncheck everything except Auto Reboot and F. Reset Time. Now, connect your phone thru USB and wait for a blue box to appear in ODIN. Say your prayers now, then hit Start.


After a few minutes, the firmware reflash should be done and your phone start to boot up. Don't worry if it takes too long to boot, this is usually normal if you didn't do anything wrong.