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!

Comentarios

Entradas populares de este blog

Backup and restore a postgresql DB

Git: how to use .gitignore

Why to diagram all before start coding