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 !

--

--

tanut aran
tanut aran

Written by tanut aran

Co-founder and Coder at work !

No responses yet