It is cutting off our nose to spite our face.
The coward who threw away his forces at the last moment to spite a superior enemy.