Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My wife saw the folder 'all documents' in Finder and decided to move it all to the trash.

Now we have over 9,000 files in the trash and I haven't been able to find a way to put back everything with one click.

For some reason it will only let me 'put back' one file at a time.

Is there any way to automate this?

share|improve this question
If she dragged the folder into the trash, then just drag it back out? – henryaaron Jan 25 '12 at 5:58
up vote 7 down vote accepted

If "Put Back" is disabled for a multiple-item selection it means that (at least) one of the items selected doesn't have its original location information stored in the Trash directory's .DS_Store file.

Though it's less than ideal, try multi-selecting subsets of the files looking for groups that you can "Put Back" en masse before resorting to manual filing for the remaining files.

share|improve this answer
I can't seem to "Put Back" files en masse. I can select either file and the option to put back is there but when I select both "Put Back" is not available. Thus I don't think you can "Put Back" en masse. Maybe with an applescript though... – Steve Moser Feb 3 '13 at 16:12
This answer is incorrect. I'm in a state where any individual file can be "Put Back" but if I select more than one file I cannot, which is inconsistent with your answer. – Tom Swirly Nov 16 '14 at 0:46

Try running a script like this in AppleScript Editor:

    tell application "Finder"
        close windows
        if items of trash is {} then return
        open trash
    end tell
    tell application "System Events"
        key code 125 -- down arrow
        key code 51 using command down -- command-delete
    end tell
end repeat

If Finder shows a password dialog when you try to put back some item, try adding something like this to the end of the tell application "System Events" block:

delay 1
if exists window 1 of process "SecurityAgent" then
    tell window 1 of process "SecurityAgent"
        set value of text field 2 of scroll area 1 of group 1 to "pa55word"
        click button 2 of group 2
    end tell
end if
delay 1
share|improve this answer

you should be able to highlight every file or at least do it in incremental batches, copy them then re-paste them I believe. I just tried it and if you double click your trash can then right click the files you wish to restore there is a "put back" option which only works file by file, as said i would highlight then press C-c (command c)to copy then C-v(command v) to paste them back.

share|improve this answer

This worked for me:

  • Create a new folder in Finder, I called mine "recovered files"
  • Open Trash folder and select a group of files
  • Copy files and paste into "recovered files" folder.

If you need to put back a large folder, or a large number of individual files, use this technique. If you need only 1 or 2 files, just use the "put back" feature.

share|improve this answer
Wrong - this again does not actually "put back" the files and does not solve the issue, it merely takes them all and throws them into one big pile. – Tom Swirly Nov 16 '14 at 0:47

An AppleScript that "Put[s] back all items in the Trash" worked for me:

Open "AppleScript Editor" and copy/paste the lines below, then run the script as many times as needed.

tell application "System Events"
    tell process "Finder"
        repeat 100 times
            tell application "Finder" to open trash
            tell application "Finder" to activate
            key code 126
            key down command
            key code 51
            key up command
            delay 0.2 -- adjust delay as needed
        end repeat
    end tell
end tell
tell application "Finder" to close every window
share|improve this answer

Prior to Snow Leopard, OS X does not natively have the ability to restore files to their original locations that they were deleted from (as can be done natively in a Windows environment with the "Restore" option in the context menu for Recycle Bin). I accidentally did the same thing as your wife did at one point with around 10,000 plus files being deleted.

After exploring all my options I performed a system restore via Time Machine. It was by far the most expedient method to get said files to their proper locations.

share|improve this answer
Well, as you can easily deduce from other answers here, it is possible to put back files/folders from Trash: open Trash, right-click a file and select "Put Back". – patrix Oct 15 '12 at 18:52

Drag all files from Trash to All My Files tab in Finder. It will take a while if you have a lot of files. We tested on 10000+ files. The Finder will restore all files to its original location.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.