For every rule, you can view the complete history of whenever someone makes a change to the underlying SQL query. This is useful for troubleshooting and auditing purposes. First, go to the rule you want to inspect and click on the three dots menu button at the top right corner, and select 'View Edit History'.
You will be able to see all changes made to your rule in the past, as well as who made the change and when they made it.
If you wish to visually inspect the exact difference between the before and after version of the two queries you can use a diff checker tool like this one to see a side-by-side comparison of what changed.
If you wish to go back to a previous version of a rule you can simply copy and paste the old text back into your rule and click 'Save'.