Git log Git checkout ___commit_id___
Git log
is for showing the history of a repository; it gives us information such as commit ID, author, date, and the commit comment given by us.
We need the commit ID for use later.
Don't worry about memorizing a sequence of 40 characters. Our magic wand, Git, does the hard work of filling in the remaining characters for you to identify a commit if you supply it with the first five characters.
Now you have travelled back to a previous commit, and your files will contain the contents of the previous commit. You can view the contents of the file now.
git checkout master
; this will bring you to the latest changes.If you see a message similar to the one in the previous screenshot, you have returned to your latest changes. Again, you can view the contents of the file.
3.16.54.63