The fastest way to undo a change depends on what you changed

If you changed a setting or deleted a file in the last few minutes, Ctrl+Z (Windows) or Command+Z (Mac) will undo it in most programs. If you changed a system setting and want to go back, Windows has a built-in recovery tool called System Restore that can roll your computer back to an earlier date. If you deleted a file and the trash or recycle bin is still full, you can recover it from there. If you deleted it weeks ago or emptied the bin, recovery is harder but sometimes possible with file recovery software.

The method you use depends on three things: what you changed, how long ago you changed it, and whether you have backups. This guide covers the most common scenarios and what to do in each one.

Key Takeaways

  • Ctrl+Z or Command+Z undoes the last action in most programs and works within minutes of the change.
  • Windows System Restore can roll back your entire system to a date before you made unwanted changes, but only if restore points were created before the change.
  • The Recycle Bin (Windows) or Trash (Mac) holds deleted files for weeks or months, and you can recover them by opening the bin and dragging files back to their original location.
  • If you emptied the bin or deleted files long ago, third-party recovery software may retrieve them, but success depends on whether the disk space has been overwritten.
  • If you changed a password or login setting and are now locked out, you will need to use your recovery email, phone number, or a password reset disk created before the lockout.

Using Ctrl+Z or Command+Z to undo recent changes

The keyboard shortcut Ctrl+Z (on Windows) or Command+Z (on Mac) undoes the last action you took in almost every program — word processors, photo editors, spreadsheets, file managers, and web browsers. Press it once to undo the most recent change, and press it again to undo the change before that. You can usually undo the last 10 to 50 actions, depending on the program.

This works only for changes made within the program itself. If you deleted a file using File Explorer or Finder, Ctrl+Z will undo the deletion and restore the file to its original folder. If you changed a Windows setting in Settings or Control Panel, Ctrl+Z will not work — you will need System Restore instead.

The undo history clears when you close the program, so if you closed the program after making the change, Ctrl+Z will not help. Some programs like Microsoft Word and Google Docs keep a version history even after you close them, which you can access from the File menu to restore an earlier version of the document.

Recovering deleted files from Recycle Bin or Trash

When you delete a file on Windows, it goes to the Recycle Bin instead of being erased when ready. On a Mac, deleted files go to the Trash. Both hold files for weeks or months until the bin fills up or you manually empty it. To recover a deleted file, open the Recycle Bin (Windows) or Trash (Mac), find the file, right-click it, and select Restore or Put Back.

The file will return to the folder it was deleted from. If that folder no longer exists, the file will go to the root of the drive (usually C: on Windows or Macintosh HD on Mac). If you do not see the file in the bin, it may have been permanently deleted, or the bin may have been emptied.

On Windows, you can check how full your Recycle Bin is and change how long it keeps files before auto-deleting them. Right-click the Recycle Bin icon on the desktop, select Properties, and adjust the slider under "Custom size" to increase storage. On Mac, the Trash holds files until you manually empty it, so files can stay there indefinitely unless you empty it yourself.

Using Windows System Restore to roll back system changes

If you changed a Windows setting — installed a driver, updated Windows, changed network settings, or installed software that broke something — System Restore can roll your entire system back to a date before the change. System Restore does not delete your personal files; it only reverts system files and settings.

To use System Restore on Windows 10 or 11, open the Start menu, type "System Restore" into the search box, and click "Create a restore point." In the window that opens, click the "System Protection" tab, then click "System Restore." Choose a restore point from before the change was made, and click Next. Windows will restart and explore the restore point, which usually takes 15 to 30 minutes.

System Restore only works if restore points were created before you made the unwanted change. Windows creates restore points automatically before major updates and when you install new software, but it does not create them every time you change a setting. If no restore point exists from before your change, System Restore will not help. You can manually create a restore point at any time by opening System Protection and clicking "Create" — this is useful before making changes you are unsure about.

Recovering files with third-party recovery software

If you permanently deleted a file, emptied the Recycle Bin, or formatted a drive, third-party recovery software may be able to retrieve the file. Common options include Recuva (Windows, free), EaseUS Data Recovery Wizard (Windows and Mac, free version available), and Disk Drill (Windows and Mac, free version available). These programs scan your hard drive for deleted files that have not yet been overwritten.

Recovery software works best if you act quickly after deleting the file. The longer you use your computer after deletion, the more likely the deleted file's space will be overwritten with new data, making recovery impossible. If you realize you deleted something important, stop using the computer and run recovery software when ready.

read the recovery software on a different computer or external drive if possible, then plug the external drive into the computer where the file was deleted. This prevents the recovery software from writing new data to the drive you are trying to recover from. Scan the drive, preview the files found, and recover the ones you need. Most free versions recover files up to a certain size limit; paid versions have no limit.

Undoing password and login changes

If you changed your Windows password or Microsoft account password and forgot the new one, you can reset it using your recovery email or phone number. On the Windows login screen, click "I forgot my password," enter your Microsoft account email, and follow the steps to verify your identity. Microsoft will send a code to your recovery email or phone, which you use to create a new password.

If you changed a local account password (not a Microsoft account) and forgot it, you have fewer options. If you created a password reset disk before changing the password, you can use that disk to reset it. If you did not create a reset disk, you will need to use another administrator account on the computer, or you may need to reinstall Windows.

On a Mac, if you forgot your password, you can reset it using your Apple ID or recovery key. Restart the Mac and hold Command+Q to open the login window, then click the question mark icon and follow the prompts to reset your password using your Apple ID.

Preventing unwanted changes in the future

The best way to handle unwanted changes is to prevent them in the first place. Create regular backups of your important files using an external drive or cloud storage service like OneDrive, Google Drive, or iCloud. If something goes wrong, you can restore from a backup instead of trying to recover deleted files.

On Windows, enable File History to automatically back up your documents, photos, and other personal files. Open Settings, go to System, then click "Backup" and turn on "Backup with File History." On Mac, enable Time Machine by opening System Preferences, clicking Time Machine, and selecting an external drive to back up to.

Before making major changes to your system — installing new software, updating drivers, or changing network settings — create a manual restore point on Windows or a Time Machine backup on Mac. This gives you a known good state to return to if something breaks. Many experienced users also keep a list of what they changed and when, so they can pinpoint exactly what caused a problem.

Frequently Asked Questions

Can I undo a change I made days or weeks ago?

Ctrl+Z only works for changes made in the current session of a program. For system changes made days ago, Windows System Restore can roll back your system if a restore point was created before the change. For deleted files from weeks ago, recovery software may work if the disk space has not been overwritten, but success is not may provide.

What if I emptied the Recycle Bin by mistake?

Once the Recycle Bin is empty, the files are no longer visible in Windows, but they may still be recoverable with third-party recovery software. The sooner you run recovery software, the better your chances. Stop using the computer to prevent new data from overwriting the deleted files.

Will System Restore delete my personal files?

No. System Restore only reverts system files and settings to an earlier date. Your documents, photos, videos, and other personal files will not be affected. However, programs you installed after the restore point will be removed.

Can I undo a Windows update?

Yes. Open Settings, go to System, then click "Recovery." Under "Recovery options," click "Go back" to roll back to the previous version of Windows. This option is usually available for about 10 days after an update. After that, you will need to use System Restore if a restore point exists from before the update.

What should I do if I cannot remember what I changed?

Check the Event Viewer on Windows (search "Event Viewer" in the Start menu) to see a log of system changes, driver installations, and updates. On Mac, check the Console app (Applications > Utilities > Console) for error messages or system changes. These logs can help you identify what changed and when.