Won the battle, lost the war

Best definition
Won the battle, lost the war
When one is so concentrated into completing a task that he/she thought was so big, but at the end realized

it was nothing compared to the big picture that he/she lost.

I’ve passed my exam, but lost a gf. I’ve won the battle, lost the war.