What is the command to remove a container and reclaim the space? I was trying to bootcamp my Mac, but it failed halfway through and left me with a 50 GB container I can't delete. It's just a single one I can’t touch. I know there's commands to delete containers, but I don't know how to format it. 

Here's the diskutil list:

/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *500.3 GB   disk0
   1:                        EFI EFI                     209.7 MB   disk0s1
   2:                 Apple_APFS Container disk2         443.0 GB   disk0s2
   3:                 Apple_APFS Container disk1         49.1 GB    disk0s3

/dev/disk1 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +49.1 GB    disk1
                                 Physical Store disk0s3
   1:                APFS Volume Recovery                1.0 MB     disk1s1

/dev/disk2 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +443.0 GB   disk2
                                 Physical Store disk0s2
   1:                APFS Volume Macintosh HD            384.2 GB   disk2s1
   2:                APFS Volume Preboot                 42.2 MB    disk2s2
   3:                APFS Volume Recovery                1.0 GB     disk2s3
   4:                APFS Volume VM                      2.1 GB     disk2s4~~~

Essentially, how do I edit 
~~~diskutil erasevolume free none disk0s4 
 diskutil apfs deletecontainer disk0s3
 diskutil erasevolume free none disk0s3
 diskutil apfs resizecontainer disk0s2 0~~~
to delete  disk0s3?
The commands are given below. 

sudo diskutil apfs deletecontainer disk0s3
sudo diskutil erasevolume free none disk0s3
sudo diskutil apfs resizecontainer disk0s2 0


The first command converts the undesired APFS container partition disk0s3 to a JHFS+ formatted partition. The second command converts the disk0s3 partition to free space. The third command expands the desired APFS container partition disk0s2 to consume the free space.

Below is an example. Your results may be sightly different.

Marlin:~ davidanderson$ diskutil list disk0
/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *500.0 GB   disk0
   1:                        EFI EFI                     209.7 MB   disk0s1
   2:                 Apple_APFS Container disk2         450.0 GB   disk0s2
   3:                 Apple_APFS Container disk1         49.7 GB    disk0s3
Marlin:~ davidanderson$ sudo diskutil apfs deletecontainer disk0s3
Started APFS operation on disk1
Deleting APFS Container with all of its APFS Volumes
Unmounting Volumes
Unmounting Volume "Recovery" on disk1s1
Deleting Volumes
Deleting Container
Wiping former APFS disks
Switching content types
Reformatting former APFS disks
Initialized /dev/rdisk0s3 as a 46 GB case-insensitive HFS Plus volume with a 8192k journal
Mounting disk
1 new disk created or changed due to APFS operation
Disk from APFS operation: disk0s3
Finished APFS operation on disk1
Marlin:~ davidanderson$ diskutil list disk0
/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *500.0 GB   disk0
   1:                        EFI EFI                     209.7 MB   disk0s1
   2:                 Apple_APFS Container disk2         450.0 GB   disk0s2
   3:                  Apple_HFS Untitled                49.7 GB    disk0s3
Marlin:~ davidanderson$ sudo diskutil erasevolume free none disk0s3
Started erase on disk0s3 Untitled
Unmounting disk
Finished erase on disk0
Marlin:~ davidanderson$ diskutil list disk0
/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *500.0 GB   disk0
   1:                        EFI EFI                     209.7 MB   disk0s1
   2:                 Apple_APFS Container disk2         450.0 GB   disk0s2
Marlin:~ davidanderson$ sudo diskutil apfs resizecontainer disk0s2 0
Started APFS operation
Aligning grow delta to 49,790,267,392 bytes and targeting a new physical store size of 499,790,266,368 bytes
Determined the maximum size for the targeted physical store of this APFS Container to be 499,789,236,224 bytes
Resizing APFS Container designated by APFS Container Reference disk2
The specific APFS Physical Store being resized is disk0s2
Verifying storage system
Performing fsck_apfs -n -x /dev/disk0s2
Checking volume
Checking the container superblock
Checking the space manager
Checking the object map
Checking the APFS volume superblock
Checking the object map
Checking the fsroot tree
Checking the snapshot metadata tree
Checking the extent ref tree
Checking the snapshots
Verifying allocated space
The volume /dev/disk0s2 appears to be OK
Storage system check exit code is 0
Growing APFS Physical Store disk0s2 from 449,999,998,976 to 499,790,266,368 bytes
Modifying partition map
Growing APFS data structures
Finished APFS operation
Marlin:~ davidanderson$ diskutil list disk0
/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *500.0 GB   disk0
   1:                        EFI EFI                     209.7 MB   disk0s1
   2:                 Apple_APFS Container disk2         499.8 GB   disk0s2
Marlin:~ davidanderson$ 


&nbsp;