Ah, that would be "don't count your chickens before they are hatched."

Here's another: "The best laid plans of mice and men gang aft agley" (=often go wrong, do I get a bonus for posting in scots?)