forked from iicd/git-learner
		
	2.4 notes update
This commit is contained in:
		| @@ -2,9 +2,30 @@ | |||||||
|  |  | ||||||
| `HEAD^`代表版本库中的上一次提交 | `HEAD^`代表版本库中的上一次提交 | ||||||
|  |  | ||||||
|  | ### 2.4.2 reflog | ||||||
|  |  | ||||||
|  | 查看前五次提交的内容 | ||||||
|  | ``` | ||||||
|  | tail -5 .git/logs/refs/heads/master | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | 查看最后五次提交内容 | ||||||
|  | ```text | ||||||
|  | git reflog show master | head -5 | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | 得到一个更容易记录的号码`branch@{#}`,来用`git reset --<way> branch@{#}`来记录 | ||||||
|  |  | ||||||
|  | ### 2.4.3 | ||||||
|  |  | ||||||
|  | `git reset [-- filename] `用HEAD重置暂存区,加上filename之后只重置单个文件 | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
| 1. HEAD指向的branch更换成指定的commit ID | 1. HEAD指向的branch更换成指定的commit ID | ||||||
| 2. 暂存区中的内容替换成HEAD指向的branch的目录树 | 2. 暂存区中的内容替换成HEAD指向的branch的目录树 | ||||||
| 3. 把工作区替换成暂存区中的目录树 | 3. 把工作区替换成暂存区中的目录树 | ||||||
|  |  | ||||||
| `git reset --hard commit` 1 2 3 | `git reset --hard commit` 1 2 3 | ||||||
| `git reset --soft commit` 1 | `git reset --soft commit` 1 | ||||||
| `git reset --mixed commit` 1 2 | `git reset --mixed commit` 1 2 | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user