Restore and Upgrade S5 Mini to OS 5.1.1?

I have finally received the message that my S5 Mini dual sim can be now upgraded to 5.1.1.

Using Kies 3, I would like to restore the phone to its initial status, then upgrade to 5.1.1 (I need 3 GB of free space to do this, and currently I do not have that space) and then restore my last back up onto the upgraded phone.

I have never restored this phone before and I would like to know if the process I mentioned is possible, and how to do it. I used to have an iPhone 4 and restoring was easy with iTunes. I am not sure about Kies 3 as I find it very unstable and limited in its functions.

Through this process I would like also to get rid of all those folders and files that were left behind by apps that were installed and then uninstalled.

You can download the stock Samsung firmware for your model of phone, Product and CSC codes, and simply flash it to your device by following the instructions and video in the links of #1.11 of 42 Galaxy S5 models - Dummies Guide This will unroot you. Factory Data Reset. You will then need to re-root to restore your previous nandroid backup and then download and flash the updated stock firmware.

Plan B: Just download and flash the new stock Samsung firmware over your existing custom ROM, if it permits it. You could then Factory Data Reset and re-root.