I get this output in GRUB rescue
grub rescue> ls (hd0,msdos5)/
unknown filesystem
There is no need of reinstalling Ubuntu, when you see this message. This message comes when you break the existing GRUB in the MBR. No need to panic. Just repair the GRUB. Use Boot Repair. Follow my steps and let me know if problem is not solved.
Live boot (try Ubuntu) to Ubuntu from a bootable media (note that the bootable media you insert must be of the same architecture as the installed Ubuntu i.e., if you have installed Ubuntu 64 bit on your hard drive, insert a 64 bit bootable device)
Open terminal when you reach the live Ubuntu and run sudo apt-get update
Then run sudo apt-add-repository ppa:yannubuntu/boot-repair
Then again sudo apt-get update
Then sudo apt-get -y install boot-repair
After installing Boot Repair, sudo boot-repair
You will see the Boot Repair screen, click on Recommended repair and follow instructions. When everything is completed, restart your computer and you can see the GRUB, hence you can see the OS installed.
You have to reinstall Ubuntu again (if you formatted your whole drive). If you are left only with Windows 7, you must repair the MBR(Master Boot Record).
Info on how to fix Windows MBR:
Microsoft Support: https://support.microsoft.com/en-us/help/2004518/error-message-when-you-start-windows-7-the-windows-boot-configuration-data-file-is-missing-required-information (ignore the title, you are in almost the same situation.)
IMPORTANT: The 1st method (on the link above) works for you.
For the best results, use the commands in the 1st answer/post below the question in this forum: (https://www.sevenforums.com/general-discussion/17521-how-fix-mbr-through-command-prompt.html)
P.S.: In your situation, you must use a Windows Repair Disc or the Windows Installation Disc.