Luckily, it is relatively easy to get rid of gyno if you run the anti-gyno protocol mentioned by @muskate. The secret to a successful anti-gyno cycle, is running the protocol to the letter, and finish it off completely. This is a very importat point, since many guys will stop the protocol the moment they see improvements, which is the wrong thing to do if you want sustainabl results.
In any case, you should always try first the non-surgical approaches, and then use them only as a last resort.