there should be a /back sellhand command. SO when you sell something you did not want to sell you use /back sellhand to get it back.
If this was implemented then it's more likely to be /sellhand undo or /sellundo It can be annoying when you sell all of your stuff by accident but I don't think it should be implemented, you just have to be careful when using /sell hand.