informatica:git
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Last revisionBoth sides next revision | ||
informatica:git [2019/12/30 19:07] – [Añadir rama branch] jose | informatica:git [2020/10/28 09:27] – [Comandos sueltos] javi | ||
---|---|---|---|
Line 116: | Line 116: | ||
cat / | cat / | ||
</ | </ | ||
+ | |||
+ | ===== Volver a un commit previo ===== | ||
+ | |||
+ | Escenario: | ||
+ | |||
+ | * Queremos volver a un commit previo | ||
+ | * Queremos hacer un nuevo commit indicando "se ha vuelto al commit XXXX" | ||
+ | |||
+ | 1. Identificar el commit ID al que queremos volver: | ||
+ | |||
+ | git log | ||
+ | |||
+ | En este ejemplo: | ||
+ | |||
+ | commit c501b1d989d780ab17412fc646b62bfe24aa24d5 (tag: v0.10.0) | ||
+ | |||
+ | 2. Volver a ese commit en la copia local: | ||
+ | |||
+ | git reset --hard c501b1d989d780ab17412fc646b62bfe24aa24d5 | ||
+ | |||
+ | 3. **TODO**: clarificar qué hace exactamente este paso | ||
+ | |||
+ | git reset --soft HEAD@{1} | ||
+ | |||
+ | 4. Hacer un nuevo commit | ||
+ | |||
+ | git commit -m " | ||
+ | |||
+ | 5. Subir los cambios al repositorio remoto | ||
+ | |||
+ | git push | ||
===== Comandos sueltos ===== | ===== Comandos sueltos ===== |
informatica/git.txt · Last modified: 2022/01/06 20:19 by jose