How to undelete a Registry key

How to undelete a Registry key
Yaru looks and works a lot like REGEDIT - only it displays deleted Registry keys as well

Editing the Registry can be a dangerous business. Not only are you playing around with some of the most important settings on your PC, but there's no easy way to reverse whatever changes you might make.

And so if you delete something accidentally, then you could be in serious trouble.

It doesn't have to be that way, though. Deleting a Registry key is a little like deleting a file; you may not be able to see it any more, but its data is still there on your hard drive.

And so, if you equip yourself with the right program, and act quickly, then you may be able to recover the lost Registry key (or keys) and get your PC back in working order.

One of the best tools for Registry recovery is yaru (Yet Another Registry Utility). Grab yourself a copy, unzip the download file and run yaru.exe to begin. (Windows Vista and 7 users should run it as an administrator; right-click yaru.exe and select "Run as Administrator".)

You won't see any Registry values immediately because yaru works offline, and you'll need to open the relevant hive file first. To open HKEY_CURRENT_USER, say, click File > Open User Hive (local) and choose your user account; to open HKEY_LOCAL_MACHINE\Software click File > Open Software (Local); to open HKEY_LOCAL_MACHINE\System click File > Open System (local), and so on.

The tree for your chosen section of the Registry should now appear, and at the bottom of this will be a branch called Deleted Keys. Open this, browse through what's on offer, and with any luck you'll find your deleted settings.

There are no guarantees, though. If you don't act quickly after deleting a setting then there's a chance it may be overwritten by some other value, and that's what has probably happened here. Confirm that you really are looking in the right area of the Registry, and if so then you'll need to look at some other possibility for recovery.

System Restore will restore your entire Registry back to a previous version, for instance, and if you've a full system backup then that may also help.

Export and restore

If yaru managed to find your lost settings, though, then you'll need to export these in a format which can re-imported into your current Registry. And that only takes a moment. Just right-click the top-level lost key and choose the appropriate export option, which will probably be "Export keys to file [Recursive]"; this means export everything beneath this level to a Registry file. And save the results to a file called "recover.reg" (or something similar) on your desktop.

With that done, now find and double-click the file you've just saved. Windows will warn you that setting a block of Registry keys in this way can be dangerous. If you're 100% sure that you want to do it, though, click "Yes", they'll be imported, and that's it - your lost Registry settings have all been recovered.

You do need to be careful with this technique. You shouldn't assume it gives you leeway to freely delete whatever Registry settings you like, for instance - there's no guarantee yaru will be able to recover any particular value.

And you also have to be careful in deciding what to restore. If you make a mistake there, restore the wrong Registry keys by accident, then you could make your situation even worse. If you're at all unclear about any of these steps then make sure you get yourself some insurance by running System Restore and making regular system backups.

For the most part, though, yaru is an easy way to restore lost Registry keys. Powerful yet compact (the executable file is only 1.4MB), it's packed with powerful features, and is well worth a place in your portable troubleshooting toolkit.

Mike Williams
Lead security reviewer

Mike is a lead security reviewer at Future, where he stress-tests VPNs, antivirus and more to find out which services are sure to keep you safe, and which are best avoided. Mike began his career as a lead software developer in the engineering world, where his creations were used by big-name companies from Rolls Royce to British Nuclear Fuels and British Aerospace. The early PC viruses caught Mike's attention, and he developed an interest in analyzing malware, and learning the low-level technical details of how Windows and network security work under the hood.

Latest in Windows
A woman sitting in a chair looking at a Windows 11 laptop
It looks like Microsoft might have thought better about banishing Copilot AI shortcut from Windows 11
Using Zipped files and folders in Windows 11
Windows 11 should soon be faster at extracting files from compressed ZIPs – and it’s about time, frankly
Xbox Wireless Controller
Microsoft is adding a powerful new feature for using Xbox controllers with Windows 11
Woman disgusted by her laptop
Embarrassing Windows 11 bug that deleted Copilot app is now fixed – but will anyone outside of Microsoft care?
Student sat at a desk with a laptop in a dormitory looking at a mobile phone
Windows 11 could eventually help you understand how fast your PC is - as well as offer tips for making your PC or laptop faster for free
Windows 10
Microsoft gets into the spam game by again emailing Windows 10 users to prod them to upgrade to Windows 11 – is the nagging going too far now?
Latest in News
Zendesk Relate 2025
Zendesk Relate 2025 - everything you need to know as the event unfolds
Disney Plus logo with popcorn
You can finally tell Disney+ to stop bugging you about that terrible Marvel show you regret starting
Google Gemini AI
Gemini can now see your screen and judge your tabs
Girl wearing Meta Quest 3 headset interacting with a jungle playset
Latest Meta Quest 3 software beta teases a major design overhaul and VR screen sharing – and I need these updates now
Philips Hue
Philips Hue might be working on a video doorbell, and according to a new report, we just got our first look at it
Microsoft
"Another pair of eyes" - Microsoft launches all-new Security Copilot Agents to give security teams the upper hand