Goal: In this exercise you will familiarize yourself with the process of finding a file that you previously deleted and then restoring it (un-deleting it), all on GitHub.com
You may remove a file and then later on want to look at that file again, and/or you may want to put that file back into the repository. Let's look at one way of doing this in GitHub.com
The first step is to log into GitHub and find the repo that you wish to work with. Since this was covered in a prior tutorial we're not going to cover it again here.
Once you've open the repository you should click on the 'Commits' tab at the top of the list of files, as pictured here:
Once you've opened clicked on that you'll be shown a list of all the commits (changes) that have been made to the repo.
Because we want to find a file that's been deleted we'll need to go to the most recent commit that happened BEFORE we deleted the file. In the above example we're going to open the commit with the message "Experimenting with a Word file" because in the next commit the file has already been removed.
If you want to see a description of the commit itself you can click on either link that the '1' points to in the above image. To be clear: clicking on the message "Experimenting with a Word file" or clicking on the "b6dd169" in the above image takes you to the same page. It's good for you to look at that page both to see what's there, and in case you accidentally end up there when trying to restore a file later.
However, we want to browse the files that were present in the repo after that commit was made, so you should instead click on button pointed to by the '2' (which looks like two brackets: "< >" ).
At this point you'll see something that looks just like the normal list of files except that it's from a point in time in the past. Specifically, you'll notice that the file named logo_bluegrey_4in_jpg.jpg is present again:
At this point you can click on that file to see the page that describes that one file, then click on the 'Download' button and download that copy of the file back to your computer.
Once you've done that you can then go back to the main page for your repo and Upload that file again. (Since this was covered in a previous tutorial we won't talk about it here)
Please note that there are other ways of accomplishing this. For example, if the file was deleted in the most recent commit you may be able to amend that most recent commit.