Super wipe mod is a useful tool for the Samsung Galaxy S5. It wipes all cache like Cache partition, System Partition as well as Data partition. (Data partition includes all files located in internal storage. A wipe is highly recommended when you want to install a new firmware or ROM, when the phone gets slow or even when you want to sell it and want to delete everything in it.
The normal way to factory reset the Galaxy S5 is by going in Recovery Mode and wipe all cache whereas to format it you have to go to Settings > Accounts > Backup and Reset. Go through the resetting process and you are done.
However, if you want a simple script that wipes everything with just one click, you should use Super Wipe mod. (Download it here)
To use it, put the downloaded zip file into your external’s phone memory along with the ROM you want to flash. Then, in Recovery Mode, flash the script. It will delete all cache. Then install the ROM you want. Once the installation process is over, reboot your phone. Everything should be as new.