Search code examples
gitversion-controldvcsundo

GIT: Reverting last commit?


Which command do i use to revert the changes made by the last commit? The commit was already pushed to the remote server.


Solution

  • git revert HEAD
    

    That will back out the most recent commit. Then just push it up.

    You can replace HEAD with the revision you want out.