[关闭]
@hengbao 2018-06-04T03:11:48.000000Z 字数 210 阅读 1023

git 撤回上一次的commit

git


如果不小心 弄错了 git add后 , 又 git commit 了。 先使用

1.git log 查看节点 ,会出现下面这样的文字:

  1. commit xxxxxxxxxxxxxxxxxxxxxxxxxx
  2. Merge:
  3. Author:
  4. Date:

2.查找到自己想回滚到的某一个commit的状态,执行下面的语句:

  1. git reset commit_id

其中,commit_id对应上面git log查出的commit后面的内容。

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注