How do I revert the sudo less /private/etc/cups/printers.conf command?
Less isn't modifying anything in your printer settings, it's just displaying the contents of the file. For example:

less test.txt 


will show the contents of the test text file. If you exit using q, and you reopen the Terminal window, you will no longer see the IP address of the printer without using the 

less


command again.