Stem the tide, originally "stemme the tyde" comes from Old English, where it was used in the context of ocean voyaging. There, it meant to tack against the prevailing tide or stormy waves in order to avoid being steered off course, or worse.