Funny thing. You must have broken the HTML and now you can't access the site. I had thought of a similar situation 2 years ago: https://github.com/q2a/question2answer/pull/211#issuecomment-93860274 "if you rely on the UI to turn safe mode on then it is not so safe :)" => Definitely, I agree with myself :)
Anyway, your issue can easily be fixed:
1. Connect to the database using PHPMyAdmin or whatever tool you are using
2. Run this SQL query:
SELECT * FROM qa_options WHERE title LIKE 'custom%';
3. Take note of the title of the row that contains the broken HTML code in the content field. For example, if you have messed with this setting "Custom HTML in <head> section of every page" you'll need to take note of custom_in_head.
4. Run this SQL query: (warning, if you do things the wrong way you might seriously mess with the configuration of the site... I take no responsibility here! Even worse, you're following advice from a random guy from the internet who is telling you that you might seriously break things if you do):
UPDATE qa_options SET content = '' WHERE title = 'custom_in_head';