Local version Library E:\learngit
So the Learngit folder is the workspace
Learngit folder. The git/folder is a repository: contains a staging area (stage) and a pointer to master (head)
The Master branch is unique, you can add the workspace's file git add to Staging area multiple times, and then one-time git commit commits staging area modification
####### #版本的回退其实就是head指针的指向变化, the version has been
1. Modify Readme.txt again to make 3 versions available
Version 1:wrote a Readme file
is a version control system.Git is free software.
Version 2:add distributed
is a distributed version control system.Git is free software.
Version 3:append GPL
is a distributed version control system.Git is free software distributed under the GPL.
2. Learn how to fallback from version 3 to version 2
Git log view version history
You can also use git log--pretty=oneline to briefly output
The last version is, the last version HEAD^
is HEAD^^
, of course, 100 versions of the 100 ^
are relatively easy to count, so write HEAD~100
.
git reset --hard HEAD^
2. How to fallback from version 2 to version 3
git provides a command git reflog
to keep track of every single command you make.
Find the commit ID for version 3
git reset--hard commit_id
#####################################################
Working area and staging area---to write
2016/01/12 start learning git: How version fallback