Git: revert pushed commit

So many times I must to search this so here is how:

    git reset --hard <commit_hash>
    git push -f origin <branch> #in most of cases is the branch is master

and that is it, if you have other clone of the repository you must checkout first at the last 'correct' commit
   git checkout <commit_hash>
   git pull origin <branch>

thats it!


Entradas populares