When I want to try a config change without risking my running sessions, a second tmux server is the safest way to do it. It takes one flag.
The manual says tmux stores the server socket in a directory under TMUX_TMPDIR, or /tmp if that is unset, and that the default socket is named default. The -L flag picks another name:
tmux -L test -f /tmp/test.conf new -s try
That allows several independent tmux servers to run. Here -f makes the new server read a different config file, so your real ~/.tmux.conf stays untouched. Sessions on the test server do not show up in your normal tmux ls.
To list or attach to them later, repeat the flag:
tmux -L test ls
tmux -L test attach
The config file is only read when the server starts. The manual says tmux loads configuration files once when the server process has started, so -f does nothing if a server with that socket name is already running. Stop the test server first, then start it again with the new file:
tmux -L test kill-server
That ends only the server on the test socket, and your normal sessions keep running.
The caveat: every tmux command needs the same -L, or it talks to the default server and says there is nothing running. Keep that in mind when scripting. The -S flag takes a full path to a socket instead of a name, and when it is given, -L is ignored.
Further reading: tmux manual (-L socket-name)