Wordpress - Wordpress on a local machine redirecting to online url

Open up your wp-config.php file

Try adding the following to it:

define( 'WP_SITEURL', 'http://localhost/your_wordpress_folder' );  
define( 'WP_HOME',    'http://localhost/your_wordpress_folder' );

If I understand right you had restored backup of live site to local installation?

Basically you have two ways to handle it:

  1. Change site URL (I recommend RELOCATE way, always works nicely for me).

  2. Use hosts file of your OS to point live domain at your local IP (127.0.0.1).