You need to change the site url in wp-admin->Settings->General
Except now you need to go in through phpMyAdmin and do it manually in the wp_options table since you are locked out
set the site URL manually in the wp-config.php file.
Add these two lines to your wp-config.php, where "example.com" is the correct location of your site.
See this guide