In the situation you described, you may want to try to roll the boat over when the sail is downwind and standing on the bow or stern doesn’t seem to help.
We call it “cork screwing” the boat. We move all our weight to the stern such that the bows are pointing straight in the air (UP), then climb on the other hull (the one that was over our heads. This all happens very quickly, you just need to commit to the role and the boat will spin downwind putting the sails upwind. Be sure not to leg go of the boat/righting line through the role.