Messed up my partitions
I was trying to install Ubuntu on my Macbook Pro, late 2013, tried to undo everything, and I messed up the partitions. I can start up my computer and use Macintosh HD regularly, but I can no longer boot into Recovery HD. Instead it shows up as a partition under my hard drive in disk utility. I have an unmounted blank partition that I can't get rid of as well. Additionally, I can't repair the top-level disk, and it tells me a disk with a mount point is needed, or it tells me I have to fix it in Recovery Mode, which I can't do.
...Any way to fix this stuff/return my computer and partitions to default settings without losing everything? I do have a backup of my computer (and can still back stuff up regularly, I think).
MacBook Pro (Retina, 13-inch, Late 2013), OS X Yosemite (10.10.4)