10 ms·
How to lose your work using Undo Copy in Windows
- spuz 3y agoHow unfortunate. Windows should disable the Undo option as soon as the copied file is modified.
- lelandfe 3y agoCan confirm this is how macOS does it. They remove the file from the stack of Undo actions after it's been modified post-copy.
- johnwalkr 3y agoMacOS also doesn’t let you cut a file and then lose it by accidentally copying something else to the clipboard, because to “cut and paste” you copy, then use option-command-v to move the file instead of copying. I think this mistake is usually recoverable in Windows, but
- johnwalkr 3y agoOops, I accidentally undid my typing. This mistake is usually unrecoverable but sometimes not, when you’re in file explorer but it’s not a normal file explorer view. For example, when viewing the images of an attached iPhone.
- konschubert 3y agoIt's the little things that make the big difference.
- cubefox 3y agoExactly, that was my first thought.
- 29athrowaway 3y agoJetbrains IDEs have a "Local history" feature that is not well known. It watches local files and keeps a backup of previous versions of a file, independently from version control. This has saved me from a few accidental unrecoverable changes. git reflog is also your friend.
- deleted 3y ago[deleted]
- alpaca128 3y agoIirc VS Code also added that feature last year. And Vim will also let you go back to any prior state as long as you still have the file open. You can go back to a specific date/time, revert the last 5 minutes etc.
- PhilipRoman 3y agoYou can enable Vim's persistent undo by setting undofile and undodir options, that way undo works across restarts, no need to keep file open. Another cool feature is Vim's internal undo tree, which allows you to access changes that you undo-ed and then overwrote.
- deepersprout 3y agoThe folder you copy your file (any file that has some importance to you) to should be a onedrive synced folder. Word/Excel/Powerpoint/... files you edit in a synced folder save automatically without the need for you to ctrl+s. If you undo copy that file you will find it in your onedrive history.
- hnlmorg 3y agoThe solution to the “undo copy” == “permanent delete” isn’t cloud storage. The solution is simply not to enable that option if the file has been modified. Or at least hide the option behind very explicit warnings. I’m not saying cloud storage isn’t a good idea as well. But it solves a slightly different problem while creating new ones (needing a Microsoft account, needing an internet connection, files being suitable for cloud storage, etc).
- mastazi 3y agoThis happened to me once. I thought I was doing ctrl-Z inside of an app I had been using up to a few minutes earlier, but I hadn't realised that instead a File Explorer window that was currently highlighted.
- iforgotpassword 3y agoThat was my first thought when reading this: how about accidentally having explorer focused when pressing ctrl-z... Good lord. Usually Linux is more on the rough, "you're a power user so you better never make mistakes" side of things, but according to that other comment, KDE's Dolphin really nailed that scenario.
- cka 3y agoA similar annoyance is the fact that excel's undo applies to all open excel files. Make a change in a.xls, make a change in b.xls. if you ctrl-z twice with b.xls focused, it'll undo both of the above changes! This has bitten me more than once. Does anyone actually want this behavior?
- o1y32 3y agoI ran into this issue and looked it up. It was an intentional design choice, and kind of makes sense when you realize that Excel sheets can have reference of each other -- they are not necessarily independent. Of course a lot of people probably never do that in their entire lifetime when using Excel and can feel annoying.
- strictfp 3y agoThey could solve that by keeping track of references and asking you though.
- greggsy 3y agoAs a daily Excel power user, I'd prefer to just know that there is one expected behaviour, and not to be bothered by a context window. The fact that ctrl-z just changes context to the other workbook is enough notification in itself, and I can just ctrl-y otherwise.
- solarkraft 3y agoWouldn't it be a good compromise to ask you on the first occurrence?
- greggsy 3y agoNo, because I get the point about context very, very quickly. I can’t imagine anything worse than being asked every time when I know exactly what’s going to happen.
- 3y ago
- Eisenstein 3y agoDid you check the c:\users\user\appdata\local\temp folder? Make sure to enable 'show hidden files'.
- mbwgh 3y agoOne might argue that this feature should not even exist, since it does not add anything (except probems) on top of a normal "delete" which you can do anyway. Edit: I think I got this wrong. Most likely, this is due to some "Undo <action>" always being displayed.
- rpgbr 3y agoNot sure if it's the same issue, but undo (and redo) in Notepad was so frustratingly unstable. Maybe the fixed that already (my last Windows was the 8.1).
- bakugo 3y agoI have indeed lost work this way multiple times before. Wish there was some way to outright disable Undo Copy, or at least put it behind a confirmation dialog. Edit: Actually read the entire page this time and there's indeed a registry edit to disable it, but it disables every other type of undo as well which isn't ideal.
- miles 3y ago> Wish there was some way to outright disable Undo Copy The article explains how to: "Is there a way to prevent this? Yes. Just disable this silly feature using the Windows Registry. Create a DWORD entry named MaxUndoItems with a value of 0 under: HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced Alternatively you can run this equivalent command: reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v MaxUndoItems /d 0 /t REG_DWORD /f Log off or restart and the context menu option will be gone. The associated shortcut (Ctrl-Z) will be disabled too (note that this only applies to Explorer, Ctrl-Z will still work in other programs)."
- phkahler 3y ago"Undo copy" seems like it should not even exist. Delete does the same. Seems like the result of trying to hard to "improve" the UI.
- ElongatedMusket 3y agoExcept delete sends the file to the recycling bin, where it can easily be recovered. Undo copy removes the file from disk!
- jraph 3y agoNo, it makes sense. You might have copied something by mistake, undo is natural, and allows you to keep the undo/redo stack usable. It just needs to be designed very carefully and not be actionable by mistake without confirmation.
- bobbylarrybobby 3y agoIt makes sense if you accidentally paste somewhere to immediately be able to undo. But, just like in a text editor, undo should undo the most recent change. Once a copied file has edits, the copy operation isn't most recent, so that's not what should be undone. Of course, file explorer would need to be aware of changes to files it hadn't made for this to work.
- phkahler 3y agoI hate to admit it, but this is a valid point. I've used the undo/redo stack in Windows when moving files around and it can be very useful. Consistency of the UI is something I value and often fault microsoft for not having ;-) So undo the copy but they need to get it right - can't undo once the file changed.
- Szpadel 3y agoi guess simple check for file size and last modification would do the job
- phkahler 3y ago
- jmartrican 3y agoI remember a video where the author accidentally deleted all the research and work they did for the video. After panicking and calming down, they typed CTL z (or selected undo in File Explorer) and got all their files back.
- hgsgm 3y agoUndo Copy is a fine feature; there was a recent post here about clipboards and managing the cost of large copied objects. The problem here is that "undo copy" acted as "undo paste", a ridiculous bug.
- gpas 3y agoExactly what I was thinking. Copy = context to clipboard, paste = clipboard to context. Undo copy should only remove the copied thing from the clipboard.
- 2devnull 3y agoCopy/pasting and undoing pasted text makes sense.
- skitter 3y agoFor files, it's not that wrong – copying can be seen as a two step process of selecting what to copy and then where to copy it to, at which point the copy is actually performed. Undoing only the first part wouldn't undo the copy. Still, "Undo Paste" would be a clearer name.
- bloomingeek 3y agoI treat every file that's important to me the same when I have to edit it, I hit save first, then edit what needs attention. After making any change more then a few minutes of work, hit save. Undo is always the last option. I am a terribly slow typist, so this is a habit I formed many years ago.
- hilbert42 3y agoGood, that's what I do. At least it's what I do by far most of the time. Trouble is, the inevitable happens on rare occasions when I don't follow those rules. Moreover, such disasters usually happen when I'm a hurry. That's why, by now, Microsoft should have recognized that such incidents happen and responded by building in protections into Windows to avoid them.
- gpvos 3y agoThat would not have helped you in the case described in the article.
- kiririn 3y agoNo amount of hitting save would have saved the author here
- bloomingeek 3y agoMy mistake, I meant to say use "Save As" in my post. With save as used, I add a number to the existing file name, thus undo copy only erases the original file copied from one folder to the other folder. (The original file is still persevered in the first folder.) Sorry.
- ciabattabread 3y agoAnd how is that relevant to the specific scenario presented in the article?
- jeroenhd 3y agoIt should be noted that files can often be recovered if you notice soon after accidentally deleting them. You need a file recovery tool that understands your file format (Recuva is a pretty good free tool) but you can save yourself hours of work if you act quickly. These tools rely on the fact that Windows (and most other operating systems) don't zero out the filesystem when deleting files. This means that the file contents are still there, all you're really missing is the reference to the file contents. As long as the disk doesn't get overwritten, the files can be saved. The more surefire way to recover files is to stop writing to the drive as soon as you notice your mistake. If you want to use your existing OS for file recovery (much easier, but less likely to succeed) you will need to kill any program running and start a recovery program as soon as possible. Chances are you can't mark the drive you saved the file to as read-only, so speed and luck are essential. It helps to have a file recovery tool installed already, so you don't have to download and install one, increasing the probability of overwriting your precious file contents. Using easy tools like Recuva and some other paid software, you can often get files back, not only from the original location but also temp files that may have been left behind during editing. The most reliable way I know involves a Linux recovery disk. It's not exactly beginner friendly, but even moderate knowledge of Linux and the command line can save you hours of work. The most surefire way I know to recover files is to kill the machine (pull the plug, hold down the power button, etc., so the shutdown process can't write any new files) and to boot into a live Linux distro packing recovery tools. Kali has a bunch, but there are others as well. Make sure not to mount the drive read-write (you probably can't get it to mount automatically after a forced shutdown anyway) so it doesn't corrupt your files and then run recovery software. Testdisk [1] can often find deleted files, though it's built to recover partitions more than it was made to recover files. ntfsundelete[2] is a command line tool that was made to find files that were likely to be deleted. It's especially useful if you know the name of the file you're trying to recover. foremost[3] and its fork scalpel [4] are command line forensic recovery tools originally written by a member of the USAF Office of Special Investigations. They're not as well-maintained as some other tools but they're very versatile if your file format may not be recognized by other tools. Finally there's Sleuthkit [5], a file recovery tool that will run from Linux leveraging other file recovery tools as well as its own forensic recovery tools, bundled together with a nice GUI. This too was designed for forensic analysis more than anything, but the GUI can help avoid tedious command line work. With bigger files this becomes harder, because the file may be fragmented and because the larger the file, the higher the probability that new files have been written on top of the old file contents. For Bitlocker encrypted drives, you'll need to use a tool like dislocker[6]. Make sure to mount data read only though, because Bitlocker is proprietary and reverse engineered tools have a habit of corrupting data when writing to disk. [1] https://www.cgsecurity.org/wiki/TestDisk https://www.cgsecurity.org/wiki/TestDisk [2] https://linux.die.net/man/8/ntfsundelete https://linux.die.net/man/8/ntfsundelete [3] https://foremost.sourceforge.net/ https://foremost.sourceforge.net/ [4] https://github.com/sleuthkit/scalpel https://github.com/sleuthkit/scalpel [5] https://sleuthkit.org/index.php https://sleuthkit.org/index.php
- W4RH4WK55 3y agoWindows should just prompt for confirmation if the file differs. A reg key should allow a user to disable the confirmation.
- CrendKing 3y agoWindows 7 does have a delete confirmation for Undo Copy. However, either Windows 8 or 10 removed that confirmation. More reason why people missed Windows 7.
- wolpoli 3y agoYou are right. I didn't get the delete confirmation for Undo Copy on Windows 11, even though I had "Display delete confirmation dialog" checked.
- a2128 3y agoI tested to see what some popular Linux file managers do in this scenario, GNOME Files and KDE Dolphin. Neither of them have undo in the right-click menu. Pressing ctrl+Z pops up the standard "Do you want to permanently delete this file?" confirmation dialog. Dolphin goes one step further, if you say yes to the confirmation dialog, it shows an additional one: "The file (copy) was copied from (original), but since then it has apparently been modified at (time). Undoing the copy will delete the file, and all modifications will be lost. Are you sure you want to delete (copy)?"
- jraph 3y agoThe KDE project does not produce perfect software, but they have attention to details. They are also eager to receive user feedback and to reverse decision after complains. They listen. The last post of Adventures in Linux and KDE is a good example of this: https://pointieststick.com/2023/05/11/plasma-6-better-defaults/ https://pointieststick.com/2023/05/11/plasma-6-better-defaul...
- hyperman1 3y agoAgree. While not perfect, they are the best of the DE crop today for my purposes, compared to Gnome, OSX and windows.
- datavirtue 3y agoDolphin is the correct behavior.
- hilbert42 3y agoYou'd think that with Windows having an install size of some 7GB that Microsoft would still have room for a tiny amount of code that would prevent this stupid behavior from happening. For decades, there have been other stupid annoyances with Windows Explorer such not providing options in 'Copy' to allow the automatic renaming of files in cases where the destination contains files of the same name. It stands to reason that there'll be occasions when one doesn't want to overwrite destination files. For years, I often wondered about how Microsoft employees actually use the stuff they create—or if they use it at all. How can they continue to use a 'nobbled' Windows when they have the power to actually fix these annoyances? It sort of defies all logic and reason. Does anyone know the reason?
- theknocker 3y ago[dead]
- marcosdumay 3y ago> How can they continue to use a 'nobbled' Windows when they have the power to actually fix these annoyances? In a large company, just because you use something, develops it, and is on the specification process, it still doesn't mean you have the power to actually fix anything.
- Joe_Boogz 3y agoI think you’re underestimating how difficult it is to communicate cross team at a corporation as large as Microsoft.
- theknocker 3y ago[dead]
- taneq 3y agoYou know what's even more awesome? Select the desktop and press Ctrl+Z. The last thing you did in Explorer gets undone. Even if it was copying a 100GB file from a network share drive onto your local hard drive. Even if that was weeks ago. It's fantastic.
- neurostimulant 3y agoDoes it at least show a confirmation prompt?
- taneq 3y agoHaha you'd think so but nope. I found this out by hitting Ctrl+Z while editing a Word document, no realizing I'd accidentally clicked on the desktop. Next minute, the 14GB VM image that I'd copied to my local machine a week ago was missing.
- leduyquang753 3y agoYeah because the desktop is just a special File explorer view.
- motrm 3y agoI was going to post this exact issue. It's been a thing as far back as I can remember. The worst part is when you don't remember what the last thing you moved was. You know you've undone something, but you don't know what it is. Is something going to be broken now? Are you going to lose something that's now in a place where you weren't expecting it to be any more? Good luck figuring it out!
- bartvk 3y agoI get that this is a bug in Windows Explorer, I really do. But the discussion is now focusing on all sorts of workarounds like undeleting files, looking up scratch/swap files, etc. When in my opinion, the correct solution is hourly backups. On average, only half an hour of work would've been lost.
- amelius 3y agoA simple fix (for MS) would be to just compare the modification time of the copy.
- causality0 3y agoYou know, Windows really needs a single menu where you can manage and customize the contents of the right-click menu.
- LispSporks22 3y agoWhat did XP do?
- EVa5I7bHFq9mnYK 3y agoWhen Windows Explorer first appeared 30 years ago, it seemed too complex for me, so I stayed with Norton Commander and its clones that entire time. Guess stupidity can be advantageous.
- CamperBob2 3y agoAlso, I've never seen XCOPY fail this way. What is this "Windows Explorer" thing people keep referring to?
- dr_kiszonka 3y agoMy dream job would be to get hired directly by higher ups (board, VPs, etc.) and be given authority to hunt down and fix idiotic stuff like this. It is a fantasy because seemingly stupid stuff often has relatively good reasons to exist, but boy would I have a field day at most big tech companies.
- finger 3y agoYou can add a custom template to PowerPoint. Doing that you would not need to make a direct file copy like this. :)
- paulrpotts 3y agoIn typical Windows fashion, even the terrible behavior is named incorrectly. It looks like it undid the paste, not the copy.
- kmoser 3y agoThis looks like the Windows 11 interface. Thankfully Windows 10 doesn't seem to have that problem. However, Windows 11 has another glaring problem: the context menu includes a trash can icon (not labeled! Although I believe it does have a tooltip if you hover and wait) which, when clicked, deletes the right-clicked item. If you were attempting to open the trash can to look for a deleted file, you just deleted another file.