I drive 4 1/2 hours to a reptile specialist. Soak in cold water with as much sugar dissolved in the water as you can get. Soak 5 minutes and take out for 5 minutes and apply KY Jelly, then soak 5 more minutes and then apply KY. Continue to do this until either he pulls it back in or you get him to the vet. If he doesn't pull it back in on his own he will probably need it amputated.
Without help from a vet, your guy could actually die from prolapsed hemipene.
Jann's advice is spot on and I have actually used it on more than one occasion. However, a vet did tell me to use honey rather than sugar water.
The reason for using anything with sugar is for the osmotic affect- the hypertonic honey or sugar water draws the fluid out of the swollen hemipene, shrinking it back into place. The honey is thicker and will have a longer lasting affect simply because it sticks around, coating the surface rather than running off.
Also, I would recommend keeping the male in a tank or tub that has soaking wet paper towels on ground with nothing for the chameleon to climb on. That way the hemipene will be in contact with moisture and not dry out. Reapply the honey as needed.
BOTTOM LINE - get to a vet. It is possible to amputate one hemipene and the other hemipene (yes there are two) can still work, (produce babies.)
KY is a great thing to use .. the jelly is messier then the water solubale kind "less messy" keep applying it an see if after alil he can pull it bk himself if not youll haveta help him doit just remember gently