Will restoring my iPhone 4 remove the unlock?

I have an unlocked iphone 4, Att unlocked it for me to use with t-mobile.
I want to restore it to delete the data and everything off of it would this remove my unlock?

Yes it will

I'm going to assume AT&T didn't use a jailbreak/software unlock on your phone so you'll be good to go. And even if you're not… If AT&T really did unlock the phone for you the first time, why wouldn't they do it a second time? If you can't get AT&T to do it, try here: http://gsmunlocklabs.com/unlock-iphone/