Boot Repair is the simple graphical tool used to repair, restore or reinstall the grub bootloader on Ubuntu.
When you install Windows after Ubuntu your Ubuntu will not boot anymore and its grub may be wiped out. To restore it follow the steps below.
You need to have Ubuntu Live CD or Live USB. Boot using your Ubuntu Live CD or Live USB, while booting choose Try Ubuntu.
Once booted connect to the internet and and run the following commands in terminal to install the boot repair.
1. Add boot-repair to the repository
sudo add-apt-repository ppa:yannubuntu/boot-repair
2. Update your repository
sudo apt-get update
3. Install boot-repair
sudo apt-get install -y boot-repair
After completing the installation run Boot-Repair from terminal by entering the following command.
It will scan the System for few seconds and will show you the options Recommended repair and Create a BootInfo summary. By clicking the Recommended Repair it will start repair the grub.
Once done click ok and restart your system, your grub should work now.