在没有git add之前:

1.撤销所有更改:git checkout .

2.撤销指定文件的更改:git checkout -- file.txt

git add之后:

git reset HEAD file.txt

git push 之后:

git reset --hard  comittHash // git log --online可以查看hashid 返回到某个节点,不保留修改

git reset --soft  comittHash // git log --online可以查看hashid 返回到某个节点,保留修改

 

git reflog 查看全部提交的记录,回滚来,还可以回滚去,反复回滚,无所谓

 

 

 

相关文章:

  • 2021-05-30
  • 2022-03-05
  • 2022-02-08
  • 2021-07-06
  • 2021-04-28
  • 2021-11-15
猜你喜欢
  • 2021-11-06
  • 2022-12-23
  • 2021-12-21
  • 2022-12-23
  • 2021-08-28
  • 2022-12-23
相关资源
相似解决方案