Interesting. How did you manage to delete those topics? You shouldn’t be allowed to delete them in the UI.
First, let’s see if the topics are really gone.
./launcher enter app
If the topics are really gone, create two new topics in the Staff category and assign the topic ids in the rails console to the site settings.
SiteSetting.guidelines_topic_id = 4711 # replace with topic id
SiteSetting.tos_topic_id = 4712 # replace with topic id
And then replace the content of those topics by using the “Manual Update” described in Update seeded categories and topics