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

Publicado em: 29 Novembro 2025
no 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


Nesta página do site você pode assistir ao vídeo on-line How to Undo a Commit in Git (Without Breaking Everything) duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário AyyazTech 29 Novembro 2025, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 273 vezes e gostou 4 espectadores. Boa visualização!