Accidentally messed up URLs

Codex has an article on Changing The Site URL, you can edit values in database or override them in config.

To have your site work from root you can either relocate WP there altogether or configure it to support root of the site, while still residing in subdirectory. See Giving WordPress Its Own Directory on the latter.