If you have a file or folder that you accidentally put into the Trash on your Mac and want to restore to its original location.
Open the Trash Folder, select the file in question and press Command + Delete on your keyboard.
Alternatively, you can select File > Put Back from the Menu Bar, or right(control)-click and select Put Back from the drop down Menu.
The file will then be returned to the folder from which it was originally moved to the Trash.
Tap/click the image
to see a small movie showing this process
Alternatively, you may wish to place the file in another location.
To do this, click and drag the file out of the Trash to your desktop, or another folder.
Finally, if you delete something accidentally, and want to get it back, you can also press Command-Z immediately to undo the move to Trash.
The following support article from Apple covers deleting files AND removing files from the Trash.
Be aware that Sierra allows you to Empty Trash Automatically. This permanently deletes files that have been in the Trash for more than 30 days. Further details can be found in this Apple support article.