You can also try to use this [tool](https://help.ubuntu.com/community/Boot-Repair. I didn't try myself :)
YOU NEED INTERNET CONNECTION TO SOLVE THIS
So this you have to do it carefully as you might destroy your OS completely. Now you have just corrupted the grup (and sure deleted swap but you can create it later). First boot from a live USB and open terminal. Then use fdisk
to locate the partition where your OS is installed.
sudo fdisk -l
You will get somethings like
/dev/sda1 Linux
/dev/sda2 Extended
Now we want the one that has Linux next to it. In my case it's /dec/sda1
. We will mount it now.
sudo mkdir /mnt/temp
sudo mount /dev/sda1 /mnt/temp
Now you have to act as the chroot to modify the root partition.
for i in /dev /dev/pts /proc /sys; do sudo mount -B $i /mnt/temp$i; done
sudo cp /etc/resolv.conf /mnt/temp/etc/resolv.conf
sudo chroot /mnt/temp
Then you have to delete the grub components and reinstall them again.
apt-get purge grub grub-pc grub-common
apt-get update && apt-get install grub grub-pc grub-common
update-grub
exit
Then you can reboot your system and it will be just fine. It's time to create a swap again (if you want), you can check here. Otherwise I can help you further.