diff --git a/notes/2.4-git_reset.md b/notes/2.4-git_reset.md index 139597f..32b7754 100644 --- a/notes/2.4-git_reset.md +++ b/notes/2.4-git_reset.md @@ -1,2 +1,12 @@ +### 2.4.1 reset + +`HEAD^`代表版本库中的上一次提交 + +1. HEAD指向的branch更换成指定的commit ID +2. 暂存区中的内容替换成HEAD指向的branch的目录树 +3. 把工作区替换成暂存区中的目录树 +`git reset --hard commit` 1 2 3 +`git reset --soft commit` 1 +`git reset --mixed commit` 1 2