Typically, when I would like to keep a copy of the original file for such occasions, I will just make a copy of the file in the same directory. For example, using the samba configuration file:
sudo cp smb.conf smb.orig
Assuming you are running that command from inside the directory where the samba configuration file is located. It’s probably not a bad idea to get in the habit of using full paths so it wont matter as much where you are in the file structure:
sudo cp /etc/samba/smb.conf /etc/samba/smb.orig
However, to answer your question more directly, there is not an easy way that I am aware of. You could probably google for smb.conf and come up with something.