Well after a while, they realize your only helping them and they aren't going to get hurt. So the trust builds and soon they wont even care what you do to them. Most of my snakes aren't even head shy and will gladly let you touch their head, but some of my other snakes will retract back ASAP and can be very quick when you get near the head.
If that doesn't work you can try the pillow case trick, which is the same concept, just you stick them in a pillow case instead of a tub with a towel.