First you have to get into the recovery options, then go advanced and find CMD. The Windows install media must be present.

Type:

bootrec /rebuildbcd

Photo:

How-To-Boot-Into-System-Recovery-Options-For-Windows-8.1-3