git to delete the branch and fall back to a previous version submitted

1.git create and delete branches:

  Created: git branch branch name

  Local delete: git branch -D branch name

  Remote delete: git push origin: branch name

2.git fall back to the version submitted previously

  git log: View logs submitted

  git reset --hard commit_id(这个是提交的id,可以通过上面的命令查看要回退的那个提交版本的id,或者直接到git的网站上面看分支的提交记录,里面也可以获取到你要回退的那个提交的id):本地仓库回退,不影响远程,有需要再自己push

Guess you like

Origin www.cnblogs.com/maycpou/p/11934436.html
Recommended