How to Undo a Commit in Git (Without Breaking Everything)

Publicado el: 29 noviembre 2025
en el canal de: AyyazTech
273
4

Made a wrong Git commit? Don't panic! In this video, I'll show you 3 safe methods to undo your last Git commit without losing your work.

⏱️ TIMESTAMPS:
0:00 - The Problem: Wrong commit made
0:36 - Method 1: Soft Reset (git reset --soft)
2:06 - Method 2: Hard Reset (git reset --hard)
2:47 - Method 3: Revert (git revert)
4:46 - Recap: When to use each method
5:10 - Outro

📌 COMMANDS USED:
git reset --soft HEAD~1
git reset --hard HEAD~1
git revert HEAD

📝 READ MORE ON MY BLOG:
🔗 https://ayyaztech.com

💡 More Git & developer tutorials coming soon!

---

🔔 SUBSCRIBE for more programming tutorials:    / @ayyaztech  

👍 If this helped you, smash that LIKE button!

💬 Have questions? Drop a comment below - I reply to everyone!

---

#git #programming #developer #tutorial #gitcommit #github


En esta página del sitio puede ver el video en línea How to Undo a Commit in Git (Without Breaking Everything) de Duración hora minuto segunda en buena calidad , que subió el usuario AyyazTech 29 noviembre 2025, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 273 veces y le gustó 4 a los espectadores. Disfruta viendo!