Bootcamp Error: The startup disk cannot be partitioned or restored to a single partition Earlier today, I tried to install a Boot Camp installation of Windows 10, but there was an error and was removing the partitions it made, but I accidentally closed the window and now I'm stuck with an extra partition. 

When I run diskutil list, this is what I get:



FYI, this is a MacBook Pro 13 inch (base model) with Mojave 10.14.1.
What can I do to get my drive back to normal (with just the Macos installation)?
Here is the commands you need to enter in a Terminal application window.

sudo diskutil eraseVolume free none disk0s4
sudo diskutil eraseVolume free none disk0s3
sudo diskutil apfs resizeContainer disk0s2 0


These commands will have removed the Windows partitions and expanded the macOS partition to recover the free space. However, there may still be Windows boot files stored in the hidden EFI partition (disk0s1). If these files exist, then they can be removed by entering the commands given below.

sudo diskutil mount disk0s1
cd /Volumes/EFI/EFI
rm -r Boot
rm -r Microsoft
cd ~
diskutil unmount disk0s1