To attempt to prevent something from happening but too late to prevent damage being done
John Gower’s Middle English poem Confessio Amantis published in 1390: For whan the grete Stiede Is stole, thanne he taketh hiede, And makth the stable dore fast.