Well, you really do not want to swim against the current, because nature will always win that battle, but to lessen the current you can swim close to the bottom, or close to anything because the current isnt't usually as strong near the bottom. If you are in an emergency position the best thing to do is to stay calm and let it run its course, and if you have to swim try swimming up down or left and right. I have been in this situation and it is scary, but I just headed to the surface and inflated my BCD and rested.

The only time I was in this type of situation, we were able to swimming back in and the in and out of the surf was really strong. We held onto reef (with dive gloves) when surf sucking out and used the ingoing waves to get in. I always wear good pair of dive gloves.