How to remove a partition with terminal?
The command
sudo  diskutil  eraseVolume  jhfs+  MyVolume  disk0s4

should make the partition visible in the Disk Utility application. This command will erase the contents partition 4. You should probably quit the Disk Utility application before entering this command.
Once disk0s4 becomes visible in the Disk Utility application, you can remove the partition and reclaim the space.