前功尽弃
qián gōng jìn qì
Literally: “earlier efforts all thrown away”
All the effort made so far is wasted, because of giving up or one failure.
English has a similar saying: back to square one
Background
Su Li, a Warring States adviser, suggested warning the Qin general Bai Qi with a story: the archer Yang Youji could hit a willow leaf from a hundred paces, but one miss from tiredness would wipe out all his earlier success. So could one failed attack. The Strategies of the Warring States reads 前功尽矣; 前功尽弃 comes from the Records of the Grand Historian.
Source: Zhan Guo Ce (Strategies of the Warring States); also Records of the Grand Historian (Shiji)
How to use 前功尽弃
Warns that quitting or one mistake would waste all earlier work. Often 不能前功尽弃 or 以免前功尽弃.
Example sentences
已经坚持跑步三个月了,现在放弃就前功尽弃了。
Yǐ jīng jiān chí pǎo bù sān gè yuè le, xiàn zài fàng qì jiù qián gōng jìn qì le.
You've kept running for three months — giving up now would throw all that effort away.
电脑突然死机,文件没保存,一下午的工作前功尽弃。
Diàn nǎo tū rán sǐ jī, wén jiàn méi bǎo cún, yī xià wǔ de gōng zuò qián gōng jìn qì.
The computer suddenly froze and the file wasn't saved — a whole afternoon's work, gone.