Literally 'lose sheep, mend pen.' From a story in 战国策 (Strategies of the Warring States): a shepherd lost sheep because his pen was broken, but his neighbor said it wasn't too late to repair it.
Suīrán sǔnshī yǐjīng fāshēng le, dàn wángyáng-bǔláo, wéi shí wèi wǎn.
Although the loss has already happened, it's not too late to fix things.
Tips
usage
This idiom is almost always followed by 为时未晚 ('it's not too late') or 犹未迟也 (classical version of 'still not late'). It's the Chinese equivalent of 'better late than never.'