Git: Revert Last Commit

tanut aran
Jan 10, 2021

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 !

--

--