This is a simple script to reset a site URL. It should be deleted after it's used.
<?php
// Fill in your WordPress URI below
$uri = 'http://www.example.com/wordpress/';
require('wp-config.php');
$wpdb->query("UPDATE $wpdb->options SET option_value = '$uri' WHERE option_name = 'siteurl' OR option_name = 'home'");
echo "Blog and WordPress address have been reset to <code>$uri</code>.";
?>