Skip to content

Instantly share code, notes, and snippets.

View fullstackgithub's full-sized avatar
🎯
Focusing

fullstackgithub

🎯
Focusing
View GitHub Profile
@fullstackgithub
fullstackgithub / desfazendo-push.md
Created May 22, 2021 20:14 — forked from davidalves1/desfazendo-push.md
Desfazendo um git push

Desfazendo um git push

Não é possível desfazer um push diretamente, como é feito com o commit utilizando o comando $ git reset --soft|mixed|hard hash-do-penultimo-commit

Para desfazer um push são necessários 3 passos:

  1. Utilizar o comando $ git reset --mixed hash-do-penultimo-commit e em seguida utilizar o comando $ git stash
  2. Utilizar o comando $ git revert hash-do-ultimo-commit
  3. Utilizar o comando $ git stash apply