How to reset to previous commit.

Sometimes you may face situation where you need to take older commits and push it to repo.
For this we can do below steps:-

1.) git reset --hard <commit_hash>

2.) git push origin <branch_name> --force

Key here is forcing the push, no extra commits/commit messages etc

Comments

Popular posts from this blog

map struct :- Caused by: org.apache.maven.plugin.compiler.CompilationFailureException: Compilation failure

Running docker as non-root user