#git log – shows the commits done on the repository along with commit id, statement, user and timestamp. More on git log and the options documented : https://www.atlassian.com/git/tutorials/inspecting-a-repository#git-log
#git revert <commit-id> – revert to old commit.. In the above screen shot there is “Delete pullrequestfile.txt” with commit-id “cc6ddb…..” which I’ve committed after deleting the file. Now I want to revert to get the file back.
But what if you have updated a file and reverted to the old commit ?? what if you have updated a file and “git pull” fetches the updated file from remote repository ?? Git keeps track of file changes and if the file is updated raise a “merge conflict” and ask the user to resolve.
# git reset –hard <commit-id> – discard current changes and go back to commit with comit-id.