Skip to content

Instantly share code, notes, and snippets.

@perseoq
Last active April 29, 2025 14:19
Show Gist options
  • Select an option

  • Save perseoq/44000dd291241f7f6a6abb217e8688e8 to your computer and use it in GitHub Desktop.

Select an option

Save perseoq/44000dd291241f7f6a6abb217e8688e8 to your computer and use it in GitHub Desktop.
Formas de regresar a un viejo commit

Métodos de hacer reverse a un commit

método 1

git reset --hard <hash-del-commit>
git push --force origin HEAD

En lugar de usar --force para regresar de forma local al viejo

git checkout -b nueva-rama-desde-3be46d8

método 2

git revert <hash-del-commit-más-reciente>..HEAD
git push origin main

método 3

git reset --hard <hash-del-commit>
git push --force origin main

verificar el estado actual:

git status
git log --oneline -n 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment