1. 重新取回历史版本

git log

git checkout (这里写 上面查询出来 commit 后面的哈希值)


2. 此时使用git push会碰到如下问题:

$ git push

fatal: You are not currently on a branch.
To push the history leading to the current (detached HEAD)
state now, use
git push origin HEAD:<name-of-remote-branch>

 

解决方案:

git checkout -b temp 切换到一个临时的分支

git checkout master 再切换回主分支

git push

相关文章:

  • 2021-09-30
  • 2021-06-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-09-16
  • 2021-07-30
  • 2022-12-23
  • 2022-02-05
  • 2022-02-07
  • 2022-02-09
相关资源
相似解决方案