Humans hate losing, and we want our decisions to turn out well. Therefore, we sometimes overcommit to bad decisions. It’s often wiser to cut our losses. As Warren Buffet says: When you find yourself in a hole, it’s time to stop digging.

More:

Sunk cost (Wikipedia)