Been there, done that, sucks. Last time I did it was water skiing --- it's pretty panic-inducing when it happens in the water.
Having the wind knocked out of you is basically a cramp or spasm in the diaphragm. The trick to stretch your diaphragm and it will release. Reach behind you, grab your heels and arch your belly forward, and bingo, it releases.