WordPress Accidentally changed site URL

In my previous project accidentally changed site url in the wordpress gerneral settings tab. As i don’t have wordpress admin login details i added following lines in the wp-config.php file to change the WP_HOME and WP_SITEURL.

Just add following lines inside the wp-config.php file inside PHP tag.

define('WP_HOME', 'http://' . $_SERVER['SERVER_NAME']);
define('WP_SITEURL', 'http://' . $_SERVER['SERVER_NAME']);