Languages
[Edit]
EN

Git - revert last commit

10 points
Created by:
Dragontry
731

In this short article we would like to show how to revert last commit in Git.

Quick solution:

git reset --soft HEAD~1

 

Troubleshooting

Often it is necessary to push branch with force to override remote changes.

We can do it using the below command:

git push force

 

Alternative titles

  1. Git - rollback last commit
  2. Git - remove last commit
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

Git

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join