https://hub.fastgit.org/

还原有三种情况:

只是修改了文件,没有任何 git 操作
修改了文件,并提交到暂存区(即:编辑之后,进行git add 但没有 git commit -m "留言xxx")
修改了文件,并提交到仓库区(即:编辑之后,进行git add 并且 git commit -m "留言xxx")
如果是情况1:

git checkout -- aaa.html 			// 指定还原`aaa.html`文件
git checkout -- * 					// 还原所有文件

如果是情况2:

git log --oneline            // 可以省略
git reset HEAD               // 回退到当前版本
git checkout -- aaa.html

如果是情况3:

git log --oneline   			 // 可以省略
git reset HEAD^    				 // 回退到上一个版本,注意看HEAD后面有个 ^						HEAD^ 是回退到上个版本					HEAD^^ 是回退到上上个版本					HEAD~数字 是回退到数字个版本
git checkout -- aaa.html

相关文章:

  • 2022-12-23
  • 2021-10-11
  • 2022-12-23
  • 2021-06-17
  • 2021-09-24
  • 2022-02-11
  • 2021-07-22
猜你喜欢
  • 2021-09-21
  • 2022-12-23
  • 2021-10-17
  • 2022-12-23
  • 2021-12-04
相关资源
相似解决方案