I know that there is a possibility that we could find some articles on the internet with this thematic, but let me add my own version.

Programmatic Un-Canceling orders should not be the best way to resolve the issues with an order canceled by mistake.

It is more recommended to re-create the order from the admin instead (if possible). But there are some specific situations in which we really need to do this, so let’s get to the code:

$order = Mage::getModel('sales/order')->loadByIncrementId($incrementId);
 'pending_payment', 'This order is uncanceled by Admin!');
//Don't forget to un-cancel order items ...
foreach ($order->getAllItems() as $item) {