Can't restore registry to previous settings

I tried to change the default storage location of my program files from my SSD to my HDD by changing values in regedit. Now I can't open regedit, Windows Defender, or run cmd as admin. Is there a way I can restore the registry only?
 
Back