Git: Revert Last Commit

Git Jul 13, 2023

TDLR;

There are many methods but this method:

  1. Don’t require push --force because we create new commit
  2. Content is revert of the last commit
    e.g. If last commit add hello this commit will delete hello
$ git revert HEAD

Then push the change to the repos

$ git push

Cheers !

Tags

TeamCMD

We are CODEMONDAY team and provide a variety of content about Business , technology, and Programming. Let's enjoy it with us.