Hi Abhilash,
We can use Xrm.Navigation.openConfirmDialog function to invoke a modal dialog.
For confirmation logic, we should create a global variable in js library to save previous value of option.
If choose "ok", only set variable to value of current selected option.
If choose "cancel", set current option with variable, then update variable to value of current selected option.
1. Run onFormLoad function at form OnLoad event, it is used to get initial value of optionset field.

2. Run onFieldChange function at the optionset field OnChange event.

3. The JScript web resource code.
var previousValue;
function onFormLoad(executionContext) {
var formContext = executionContext.getFormContext();
previousValue = formContext.getAttribute("preferredcontactmethodcode").getValue();
}
function onFieldChange(executionContext) {
var formContext = executionContext.getFormContext();
var confirmStrings = { title: "Optionset update", text: "Are you sure to change it?", };
var confirmOptions = { width: 450, height: 200 };
Xrm.Navigation.openConfirmDialog(confirmStrings, confirmOptions).then(
function (success) {
if (success.confirmed) {
previousValue = formContext.getAttribute("preferredcontactmethodcode").getValue();
} else {
alert(previousValue);
formContext.getAttribute("preferredcontactmethodcode").setValue(previousValue);
previousValue = formContext.getAttribute("preferredcontactmethodcode").getValue();
}
});
}
Test:
The value of initial option is 4.

If I choose Ok, then Email(2) will be set to variable as previous value, the field will be set to new selected option directly.

If I choose Cancel, the debugging alert will tell me the previous option is Fax(4), and the field will be rolled back to Fax(4).

You could keep alert to test whether my code works for you(It works well from my test),
then remove the statement if it passes your test.
Regards,
Clofly