In order to restore deleted categories, it's mandatory to know in advance the ID of the category which was deleted. For this you can go to another environment (Production or Demo), check if the deleted category still exists there and copy the ID in case it does.
Having said that, the steps are:
- You deleted a category and you figured out that you should have not done it, so you wish you could restore it.
- Go to another environment and check if the category exists there.
- Copy the ID of the category
- Open a random category in the environment you deleted your category from and replace the category ID for the one you just copied in step 3.
- Once the category is open, you will have a new button which is called: "Restore". Click on restore and... voilà! The category is back!