Skip to content

Commit

Permalink
varios git volver a un commit anterior
Browse files Browse the repository at this point in the history
  • Loading branch information
jolav committed Jun 7, 2024
1 parent 5ba865f commit 07f7cca
Show file tree
Hide file tree
Showing 24 changed files with 84 additions and 40 deletions.
22 changes: 22 additions & 0 deletions docs/varios.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,28 @@ Si añadimos algo a .gitignore ya no se commiteara pero tampoco desaparece lo ex
`git reset --hard HEAD~5` - elimina los ultimos 5 commits
`git push origin -f` - sincroniza la nueva situacion

* **Volver a un commit anterior sin modificar el head**

```sh
# Paso 1: Encuentra el hash del commit
git log

# Paso 2: Crea una nueva rama como backup (opcional pero recomendado)
git checkout -b nueva-rama

# Paso 3: Actualiza el directorio de trabajo al estado del commit
# Reemplaza <commit-id> con el hash del commit al que deseas volver
git checkout <commit-id> .

# Paso 4: Añade los cambios al índice (si es necesario)
git add .

# Paso 5: Haz un nuevo commit (si es necesario)
git commit -m "Revertir al estado del commit <commit-id>"

# Paso 6: Empuja los cambios al repositorio remoto (si es necesario)
git push origin nueva-rama
```

[Reducir el tamaño del directorio .git](https://stackoverflow.com/questions/2116778/reduce-git-repository-size)

Expand Down
2 changes: 1 addition & 1 deletion www/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ <h3>Contenidos</h3>

<!--
MkDocs version : 1.4.2
Docs Build Date UTC : 2024-03-04 09:56:36.855255+00:00
Docs Build Date UTC : 2024-06-06 15:47:41.415095+00:00
-->
</body>

Expand Down
2 changes: 1 addition & 1 deletion www/css/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1504,7 +1504,7 @@ <h3>Contenidos</h3>

<!--
MkDocs version : 1.4.2
Docs Build Date UTC : 2024-03-04 09:56:36.885160+00:00
Docs Build Date UTC : 2024-06-06 15:47:41.443206+00:00
-->
</body>

Expand Down
2 changes: 1 addition & 1 deletion www/debian/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2488,7 +2488,7 @@ <h3>Contenidos</h3>

<!--
MkDocs version : 1.4.2
Docs Build Date UTC : 2024-03-04 09:56:36.904292+00:00
Docs Build Date UTC : 2024-06-06 15:47:41.454216+00:00
-->
</body>

Expand Down
2 changes: 1 addition & 1 deletion www/expressjs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1489,7 +1489,7 @@ <h3>Contenidos</h3>

<!--
MkDocs version : 1.4.2
Docs Build Date UTC : 2024-03-04 09:56:36.928806+00:00
Docs Build Date UTC : 2024-06-06 15:47:41.468494+00:00
-->
</body>

Expand Down
2 changes: 1 addition & 1 deletion www/frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ <h3>Contenidos</h3>

<!--
MkDocs version : 1.4.2
Docs Build Date UTC : 2024-03-04 09:56:36.937912+00:00
Docs Build Date UTC : 2024-06-06 15:47:41.477511+00:00
-->
</body>

Expand Down
2 changes: 1 addition & 1 deletion www/golang-bases-de-datos/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,7 @@ <h3>Contenidos</h3>

<!--
MkDocs version : 1.4.2
Docs Build Date UTC : 2024-03-04 09:56:36.939858+00:00
Docs Build Date UTC : 2024-06-06 15:47:41.479589+00:00
-->
</body>

Expand Down
2 changes: 1 addition & 1 deletion www/golang-para-web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1556,7 +1556,7 @@ <h3>Contenidos</h3>

<!--
MkDocs version : 1.4.2
Docs Build Date UTC : 2024-03-04 09:56:36.941297+00:00
Docs Build Date UTC : 2024-06-06 15:47:41.481288+00:00
-->
</body>

Expand Down
2 changes: 1 addition & 1 deletion www/golang-snippets/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2464,7 +2464,7 @@ <h3>Contenidos</h3>

<!--
MkDocs version : 1.4.2
Docs Build Date UTC : 2024-03-04 09:56:36.946480+00:00
Docs Build Date UTC : 2024-06-06 15:47:41.487585+00:00
-->
</body>

Expand Down
2 changes: 1 addition & 1 deletion www/golang/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3125,7 +3125,7 @@ <h3>Contenidos</h3>

<!--
MkDocs version : 1.4.2
Docs Build Date UTC : 2024-03-04 09:56:36.952816+00:00
Docs Build Date UTC : 2024-06-06 15:47:41.493892+00:00
-->
</body>

Expand Down
2 changes: 1 addition & 1 deletion www/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1282,7 +1282,7 @@ <h3>Contenidos</h3>

<!--
MkDocs version : 1.4.2
Docs Build Date UTC : 2024-03-04 09:56:36.971034+00:00
Docs Build Date UTC : 2024-06-06 15:47:41.510199+00:00
-->
</body>

Expand Down
2 changes: 1 addition & 1 deletion www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ <h3>Quick search</h3>

<!--
MkDocs version : 1.4.2
Docs Build Date UTC : 2024-03-04 09:56:36.884064+00:00
Docs Build Date UTC : 2024-06-06 15:47:41.441875+00:00
-->
</body>

Expand Down
2 changes: 1 addition & 1 deletion www/javascript-apis/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1622,7 +1622,7 @@ <h3>Contenidos</h3>

<!--
MkDocs version : 1.4.2
Docs Build Date UTC : 2024-03-04 09:56:36.977060+00:00
Docs Build Date UTC : 2024-06-06 15:47:41.516344+00:00
-->
</body>

Expand Down
2 changes: 1 addition & 1 deletion www/javascript-para-web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1736,7 +1736,7 @@ <h3>Contenidos</h3>

<!--
MkDocs version : 1.4.2
Docs Build Date UTC : 2024-03-04 09:56:36.986173+00:00
Docs Build Date UTC : 2024-06-06 15:47:41.526628+00:00
-->
</body>

Expand Down
2 changes: 1 addition & 1 deletion www/javascript-snippets/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1027,7 +1027,7 @@ <h3>Contenidos</h3>

<!--
MkDocs version : 1.4.2
Docs Build Date UTC : 2024-03-04 09:56:36.995443+00:00
Docs Build Date UTC : 2024-06-06 15:47:41.536563+00:00
-->
</body>

Expand Down
2 changes: 1 addition & 1 deletion www/javascript/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2287,7 +2287,7 @@ <h3>Contenidos</h3>

<!--
MkDocs version : 1.4.2
Docs Build Date UTC : 2024-03-04 09:56:36.998130+00:00
Docs Build Date UTC : 2024-06-06 15:47:41.539077+00:00
-->
</body>

Expand Down
2 changes: 1 addition & 1 deletion www/nodejs-bases-de-datos/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1561,7 +1561,7 @@ <h3>Contenidos</h3>

<!--
MkDocs version : 1.4.2
Docs Build Date UTC : 2024-03-04 09:56:37.010484+00:00
Docs Build Date UTC : 2024-06-06 15:47:41.551934+00:00
-->
</body>

Expand Down
2 changes: 1 addition & 1 deletion www/nodejs-snippets/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,7 @@ <h3>Contenidos</h3>

<!--
MkDocs version : 1.4.2
Docs Build Date UTC : 2024-03-04 09:56:37.019246+00:00
Docs Build Date UTC : 2024-06-06 15:47:41.557106+00:00
-->
</body>

Expand Down
2 changes: 1 addition & 1 deletion www/nodejs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ <h3>Contenidos</h3>

<!--
MkDocs version : 1.4.2
Docs Build Date UTC : 2024-03-04 09:56:37.021461+00:00
Docs Build Date UTC : 2024-06-06 15:47:41.561358+00:00
-->
</body>

Expand Down
2 changes: 1 addition & 1 deletion www/reactjs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1994,7 +1994,7 @@ <h3>Contenidos</h3>

<!--
MkDocs version : 1.4.2
Docs Build Date UTC : 2024-03-04 09:56:37.023807+00:00
Docs Build Date UTC : 2024-06-06 15:47:41.564932+00:00
-->
</body>

Expand Down
2 changes: 1 addition & 1 deletion www/search/search_index.json

Large diffs are not rendered by default.

38 changes: 19 additions & 19 deletions www/sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,97 +2,97 @@
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://jolav/chuletas/</loc>
<lastmod>2024-03-04</lastmod>
<lastmod>2024-06-06</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://jolav/chuletas/css/</loc>
<lastmod>2024-03-04</lastmod>
<lastmod>2024-06-06</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://jolav/chuletas/debian/</loc>
<lastmod>2024-03-04</lastmod>
<lastmod>2024-06-06</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://jolav/chuletas/expressjs/</loc>
<lastmod>2024-03-04</lastmod>
<lastmod>2024-06-06</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://jolav/chuletas/frontend/</loc>
<lastmod>2024-03-04</lastmod>
<lastmod>2024-06-06</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://jolav/chuletas/golang-bases-de-datos/</loc>
<lastmod>2024-03-04</lastmod>
<lastmod>2024-06-06</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://jolav/chuletas/golang-para-web/</loc>
<lastmod>2024-03-04</lastmod>
<lastmod>2024-06-06</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://jolav/chuletas/golang-snippets/</loc>
<lastmod>2024-03-04</lastmod>
<lastmod>2024-06-06</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://jolav/chuletas/golang/</loc>
<lastmod>2024-03-04</lastmod>
<lastmod>2024-06-06</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://jolav/chuletas/html/</loc>
<lastmod>2024-03-04</lastmod>
<lastmod>2024-06-06</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://jolav/chuletas/javascript-apis/</loc>
<lastmod>2024-03-04</lastmod>
<lastmod>2024-06-06</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://jolav/chuletas/javascript-para-web/</loc>
<lastmod>2024-03-04</lastmod>
<lastmod>2024-06-06</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://jolav/chuletas/javascript-snippets/</loc>
<lastmod>2024-03-04</lastmod>
<lastmod>2024-06-06</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://jolav/chuletas/javascript/</loc>
<lastmod>2024-03-04</lastmod>
<lastmod>2024-06-06</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://jolav/chuletas/nodejs-bases-de-datos/</loc>
<lastmod>2024-03-04</lastmod>
<lastmod>2024-06-06</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://jolav/chuletas/nodejs-snippets/</loc>
<lastmod>2024-03-04</lastmod>
<lastmod>2024-06-06</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://jolav/chuletas/nodejs/</loc>
<lastmod>2024-03-04</lastmod>
<lastmod>2024-06-06</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://jolav/chuletas/reactjs/</loc>
<lastmod>2024-03-04</lastmod>
<lastmod>2024-06-06</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://jolav/chuletas/varios/</loc>
<lastmod>2024-03-04</lastmod>
<lastmod>2024-06-06</lastmod>
<changefreq>daily</changefreq>
</url>
</urlset>
Binary file modified www/sitemap.xml.gz
Binary file not shown.
24 changes: 23 additions & 1 deletion www/varios/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,28 @@ <h2 id="git">GIT</h2>
</ul>
<p><code>git reset --hard HEAD~5</code> - elimina los ultimos 5 commits<br />
<code>git push origin -f</code> - sincroniza la nueva situacion </p>
<ul>
<li><strong>Volver a un commit anterior sin modificar el head</strong></li>
</ul>
<pre><code class="language-sh"># Paso 1: Encuentra el hash del commit
git log

# Paso 2: Crea una nueva rama como backup (opcional pero recomendado)
git checkout -b nueva-rama

# Paso 3: Actualiza el directorio de trabajo al estado del commit
# Reemplaza &lt;commit-id&gt; con el hash del commit al que deseas volver
git checkout &lt;commit-id&gt; .

# Paso 4: Añade los cambios al índice (si es necesario)
git add .

# Paso 5: Haz un nuevo commit (si es necesario)
git commit -m &quot;Revertir al estado del commit &lt;commit-id&gt;&quot;

# Paso 6: Empuja los cambios al repositorio remoto (si es necesario)
git push origin nueva-rama
</code></pre>
<p><a href="https://stackoverflow.com/questions/2116778/reduce-git-repository-size">Reducir el tamaño del directorio .git</a></p>
<hr />
<h2 id="mkdocs">MKDOCS</h2>
Expand Down Expand Up @@ -762,7 +784,7 @@ <h3>Contenidos</h3>

<!--
MkDocs version : 1.4.2
Docs Build Date UTC : 2024-03-04 09:56:37.029206+00:00
Docs Build Date UTC : 2024-06-06 15:47:41.570641+00:00
-->
</body>

Expand Down

0 comments on commit 07f7cca

Please sign in to comment.