Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Git回滚代码到某个commit #87

Open
yangweijie opened this issue Mar 26, 2020 · 0 comments
Open

Git回滚代码到某个commit #87

yangweijie opened this issue Mar 26, 2020 · 0 comments

Comments

@yangweijie
Copy link
Owner

Git回滚代码到某个commit
回退命令:

$ git reset --hard HEAD^ 回退到上个版本
$ git reset --hard HEAD~3 回退到前3次提交之前,以此类推,回退到n次提交之前
$ git reset --hard commit_id 退到/进到 指定commit的sha码

强推到远程:

$ git push origin HEAD --force

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant