private function revert($output, $input, $style)
    {
        /* Revert commands in backwards order */
        for($n = count($this->commandsExecuted); $n > 0; $n--) {
            $command = $this->commandsExecuted[$n-1];

            /* Revert if possible */
            if($command->hasPublicMethod('revert')) {
                $output->writeLn("Reverting $command");
                $command->revert();
                continue;
            }
            $style->warning("Command {$command->getName()} cannot be reverted, revert method is not defined");
        }
        $this->commandsExecuted = [];
    }