The short answer is: no, you can't. In food safety, the times safe at a specific temperature range are cumulative, and nothing can "reset the clock". You only get the opportunity to keep it from ticking while the food is at another temperature range, which is what Johanna suggested with the freezing.
If you need the logic behind it, beside the toxins mentioned in the other answer, you seem to also make the assumption that cooking will sterilize your food. It won't, proper cooking will just reduce the bacteria to a certain level, the usual assumption is 1 in 100 000. The food safety agencies have not modelled bacteria growth after the reheating of a dish on the verge of becoming unsafe - it is possible that after the reheat, you will have more bacteria left than after the first cooking. And even if you think "the difference must be very small", the problem is that bacterial growth is exponential, and a tiny difference in starting conditions could give you huge differences after just a few hours.
But logic aside, do not try to invent your own food safety techniques. I already hinted at it above: bacterial growth is impossibly complex, and trying to predict what you will get by commonsense knowledge and a few calculations on the back of the envelope will end up wildly wrong, similarly to trying to predict the weather a week from now by gut feeling. Leave it to the guys with the supercomputers and a body of scientific knowledge to input into the computers.