git in action
Exam
  • information
  • Gitbook
    • 1 Gitbook Start
    • 2 Gitbook Plugin Summary
  • Git
    • 1 Git Introduce
    • 2 Git Command
    • 3 Git Reset
    • 4 Git Ssh Login Without Secret
  • Github
    • 1 Github Introduce
    • 2 Github Local Pull Github
    • 3 Github Action
    • 4 Github Page
  • Gitlab
    • 1 Gitlab Deploy
    • 2 Gitlab Runner Deploy
    • 3 Gitlab Config
    • 4 Gitlab Pipline
    • 5 Gitlab Ci Config
Powered by GitBook
On this page
  1. Git

3 Git Reset


git命令行回滚

查看所有commits记录

$ git log
commit 261bbc7e909c37b877595560bb04613961d8ce81
Author: xxx xxx@.com
Date:   Mon Mar 9 15:15:29 2020 +0800

    update tomcat 7.0.90

commit 292dea9cedcf6f830eb166a3907f75eec6878a45
Author:xxx xxx@.com
Date:   Mon Mar 9 14:08:28 2020 +0800

    update start-managaer.sh and start.sh

gitlab回退到某次commit

$ git reset --hard 292dea9cedcf6f830eb166a3907f75eec6878a45

强制重新提交

$ git push origin master --force 
Previous2 Git CommandNext4 Git Ssh Login Without Secret

Last updated 2 years ago