You cant unlock your phone (remove SIM lock) from the operator by reflashing it. You will need an unlock code for that. A legal way is to obtain it from AT&T if your contract is ended, the other one is to buy it, e.g. on eBay. Once you'll get it, just enter a simple key combination to get into service menu, go to appropriate menu item and enter that code there, after that your phone is unlocked, no reflash needed.
Hope that helps.