The Apply button applies any change that you made to the configuration immediately.
The Cancel button, doesn’t undo the formerly applied changes, it just closes the dialog without any further changes. The only option you currently have is to undo the changes manually.