Placing back NBT blocks
I have an adventure map that I'm working on and there are lots of chests with custom items in them. I was trying to make it so that the Map cleans itself up and resets everything itself so i don't have to go and put each custom item back manually. So i was wondering if it was possible to place back all the chests and barrels with command blocks since you can CTRL + Pick Block and get a chest with everything inside it already.
Solution 1:
Use /clone
to copy a backup room there. Works up to 32768 blocks (for example 32×32×32), for more you need multiple commands.
Solution 2:
Structure block is a great solution to your problem. They are introduced in 1.10 and are specifically made to store blocks and entities data. Although they can only store data within a 32x32x32 cube, you can place structure blocks within that space and extend the capacity indefinitely.
I highly recommend you checking out tutorials on using structure blocks so that you have a more thorough understanding of the block.