You can follow these steps to export a registry key before you edit it:
NOTE: Do not follow these steps to export a whole registry hive (for example, HKEY_CURRENT_USER). If you must back up whole registry hives, back up the whole registry instead.
Click Start, and then click Run.
In the Open box, type regedt32, and then click OK.
Locate and then click the key that contains the values that you want to edit.
On the Registry menu, click Save Key.
In the Save inbox, select a location in which to save the .reg file, type a file name in the File name box, and then click Save.
How to restore registry keys
To restore registry keys that you exported, follow these steps:
Click Start, and then click Run.
Type regedt32, and then click OK.
In the Registry Editor window click the File menu
In the drop-down menu select Restore
In the restore key window select the folder into which the registry file has been saved
Click the file to highlight it
Clcik Open
In the Warning window click Yes to confirm the registry hive restoration