Assuming the boot loader partition is disk0s1 and we want to remove our Ubuntu (ubuntu, careful: the name may vary for your system!). The partition can be found with diskutil list.
sudo mkdir /Volumes/ESP
sudo mount -t msdos /dev/disk0s1 /Volumes/ESP
ls /Volumes/ESP/EFI
sudo cp -r /Volumes/ESP/EFI ~/EFI_backup
sudo rm -r /Volumes/ESP/EFI/ubuntu
sudo umount /Volumes/ESP