Information Technology Reference
In-Depth Information
After the successful execution of the above command the working directory con-
tains one file sing-a-song-of-sixpence.txt . You can verify it with the $ ls
command. In addition you can check the history with $ git l . The output will con-
tain only one revision:
7cfb Sing a song of sixpence
That's why I wanted you to copy the output of the $ git l command presented in
Listing 3-6 . All the revisions are contained in the database, but they are now not in-
cluded in the history. You can restore them only if you know their SHA-1 names. If
you don't know their names you can use reflog—we will learn in Recipe 3-7. The re-
pository now looks like Figure 3-4 . There are no revisions other than 7cfb in the his-
tory.
I assume that you know the names of revisions printed in Listing 3-6 . If not, start the
recipe again and this time save the history shown in Listing 3-6 .
Now, restore the revision denoted as:
f305 Internationalization: directory EN
You can do it with following command:
$ git reset --hard f305
After that command, the working directory contains the following directories and
files:
.
`-- EN
|-- baa-baa-black-sheep.txt
`-- sing-a-song-of-sixpence.txt
The repository looks like Figure 3-6 . The command $ git l prints three revi-
sions:
f305 Internationalization: directory EN
564f Baa, baa black sheep
7cfb Sing a song of sixpence
Finally, reset your repository to the latest revision shown in Listing 3-6 :
Search WWH ::




Custom Search