One way is to fire up a parallel instance of the SSH daemon on a second port, but otherwise using all the same settings. You'd obviously need some other port open at least temporarily or use a bastion or jump host:
Code:
sudo /usr/sbin/sshd -p 2222
# or
sudo /usr/sbin/sshd -p 2222 -f /root/some.test.configuration.file
The command line arguments override the configuration file, so you can add more options that way, too.
Another way is to save the working configuration and set an
at job to restore it + reload it in the daemon after a number of minutes. That way, if you can get back in you can cancel the
at job but if you can't get back in, if you set up the job correctly, you can get back in. That can certainly be used with firewall / packet filter settings, too.
I'd go with the -p option myself.