Will, erase all data and settings on my iPhone 4 with iOS 5.1.1 delete old user acc with everything?

I've been doing this for like last 24 hours and I'm really hopeless now… I've bought an iPhone 4 16GB from my friend, who has forgotten his password and loggin details while he just spit it out, registred and didn't care… I have done pretty much things, for first I hacktivated it on iOS 7.0.4, everything worked fine except I couldn't add my iCloud account and overwrite the device to me… Also, there's no service error, but I think I found solution for this in next sentences… I downloaded redsn0w jailbreak, downgraded iPhone to iOS 5.1.1, then bypassed the activation screen with 112 bug and jailbreaked it… Now I'm on the same level, everything works fine, but I have no service… I have downloaded Ultrasn0w tools for having my cellular services again, but I have higher version of basebrand and there's no way I could downgrade it or update to iPad basebrand… But this doesn't matter now…

If I will go back to Official 5.1.1 with no jailbreak and set restore all data and settings, will it delete the iCloud activation and all old user settings, so I can finally set the iPhone that it is mine device?

P.S. The Phone is really not stolen, so please before you come up with some rude answers, think about it.

Thanks for any answers, in simple way, I own jailbreaked iPod 4 now: DD

Don't ever do that because if you restore it or if you wipe the data off your phone, your will be locked until you have the icloud id and password of the previous owner

You will need the owners password to start it over clean, its a security feature you won't get around.