How to remove a container disk and reclaim space with main partition? (Similar to another question)

diskutil list

So basically im an idiot and dug myself a hole. Im nearly out of this mess but I still have one thing to do. Just need to get the data back that is in these containers. Help is much appreciated. I can send you some cookies


To convert a container to free space requires two commands. For example, disk1s5 is a APFS container. To convert to free space, you would need to enter the following commands.

sudo diskutil apfs deleteContainer disk1s5
sudo diskutil eraseVolume free none disk1s5

Free space can be added to a container, if the free space reside immediately after the container. In your case, if you converted disk1s5, disk1s4 and disk1s3 to free space, then you probably would be able add this free space to disk1s2, by entering the command given below.

sudo diskutil apfs resizeContainer disk1s2 0