When your WordPress is being down (or any other reasons you cannot access it to through the browser), you are not able to change the theme as well. However WordPress theme configuration is stored in database. Therefore you can change the theme directly in database.

 

Open the file style.css under the target theme folder. There should be the theme name after “Theme Name: “. Copy the name.

UPDATE xxx_options SET option_value = 'Twenty Fourteen' WHERE option_name = 'template';

 

Copy the name of the target theme folder and then run the following queries.

UPDATE xxx_options SET option_value = 'twentyfourteen' WHERE option_name = 'stylesheet';
UPDATE xxx_options SET option_value = 'twentyfourteen' WHERE option_name = 'current_theme';

where xxx_ is the table prefix that it is “wp_” by default

 

Reference: http://docs.appthemes.com/tutorials/how-to-change-wordpress-themes-directly-from-the-database/