Git rollback Code

Rollback command:

1. fall back to the previous version

$ git reset --hard HEAD^

2. Before submitting fall back two times before, and so, submit retreated back to before n times

$ git reset --hard HEAD~2

3. retreated / commit into the specified code sha

$ git reset --hard commit_id

Then a strong push to a remote:

$ git push origin HEAD --force

Guess you like

Origin www.cnblogs.com/Dev0ps/p/11614023.html