Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

149
Vistas
Remove commits from a branch in Git

I would like to know how I can remove or roll back to (X) commit in git.

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

You can use two ways:

  • git reset --hard HEAD~1: I WILL REMOVE THE CHANGES IN THE WORKING DIRECTORY

  • git reset --hard <sha1-commit-id>: you can git log and find a history of the commits you've made and you can go back to whatever commit you want.

For example:

 git log output: commit 5ca1232c2aad5075216df6656dfa47c297dd3438 (HEAD -> main, origin/main, origin/main, origin/HEAD, main) Author: yourUserName <yourUserEmail> Date: Tue Feb 1 19:35:33 2022 -0500 this is my commit

Once you have the commit which in our example would be " 5ca1232c2aad5075216df6656dfa47c297dd3438 " you can do git reset --hard <5ca1232c2aad5075216df6656dfa47c297dd3438>

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda