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

Publié le: 29 novembre 2025
sur la chaîne: 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


Sur cette page du site, vous pouvez voir la vidéo en ligne How to Undo a Commit in Git (Without Breaking Everything) durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur AyyazTech 29 novembre 2025, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 273 fois et il a aimé 4 téléspectateurs. Bon visionnage!