Try to access your server via SFTP or FTP, or a file manager in your hosting account's control panel, navigate to /wp-content/themes/YourThemeName/
, open functions.php
and remove the code you added.
In the future, I would recommend installing WordPress locally and testing any changes there before you do it on your live site. That is what I do and it have saved me many times!