First, why do you need to change from AHCI to RAID? If you have a good reason then:
Enable the driver you want to use before changing the SATA mode setting in the BIOS -- for Intel the driver name is usually iaStorV or iaStorSV, set its value to 0
Either delete the entire StartOverride key (or change the the value to 0) under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\(DriverNameHere)
- Reboot to BIOS setup
- Enable AHCI or RAID mode as desired
Another simple method is to just modify the Microsoft guide approach HERE
to reset to RAID from AHCI.