How to Undo a Pushed Git Commit - Reset & Revert a Git Commit After Push

  Рет қаралды 19,551

Cameron McKenzie

Cameron McKenzie

Күн бұрын

Пікірлер: 64
@Lucy-m9b3y
@Lucy-m9b3y 24 күн бұрын
Thank you so much for explaining git push --force, I couldn't work out why my git reset --hard wouldn't work until watching this video!
@cameronmcnz
@cameronmcnz 24 күн бұрын
You are most welcome. And thanks for watching. May the force be with you.
@Spyros.Charalambous
@Spyros.Charalambous 8 ай бұрын
It's the most simplified video ever! thank you so much for your time!!!
@cameronmcnz
@cameronmcnz 8 ай бұрын
Thanks for the kind words! And given the two different options and the implications of each, I'd say it's anything but simple. If you think it's simple, that's a reflection of the fact that you're smarter than the average bear. 👍
@matk2283
@matk2283 22 күн бұрын
Amazingly Brilliant explanation on git reset and git revert, and the difference between the two. my gratitude to you. much appreciated !! Mathew. K from Colorado
@cameronmcnz
@cameronmcnz 22 күн бұрын
Thanks for the kind words! Lots of pitfalls in the world of reset and revert. Glad I was able to make a confusing topic make sense to you!
@readmyheart
@readmyheart 4 ай бұрын
that intro... this guy's about to save my life. thanks in advance!
@cameronmcnz
@cameronmcnz 4 ай бұрын
Nobody gets out alive, I'm afraid. Thanks for watching and commenting!
@pravinprince3221
@pravinprince3221 9 ай бұрын
Thank you sir it is one of the best video in the Git series, it is so helpful to many of us sir, thanks again sir
@cameronmcnz
@cameronmcnz 9 ай бұрын
First comment! Thanks for the support. Every comment and like really helps out. It boosts the algo and helps get the videos in front of more people.
@jeetendranavgikar6384
@jeetendranavgikar6384 7 ай бұрын
After watching so many videos for the solution. this video got it right. thank you
@cameronmcnz
@cameronmcnz 7 ай бұрын
Why would you watch someone else's video? Happy to help!
@mytube2581
@mytube2581 3 ай бұрын
Thanks
@cameronmcnz
@cameronmcnz 3 ай бұрын
Wow! I'm always here to help, and for you, twice as much!
@ChanceMinus
@ChanceMinus 17 күн бұрын
Invaluable info. Thank you.
@cameronmcnz
@cameronmcnz 17 күн бұрын
You gotta do this the right way or you're in trouble.
@Shahroze_
@Shahroze_ Ай бұрын
Genuinely the best video I've watched for this scenario. Appreciate it!
@cameronmcnz
@cameronmcnz Ай бұрын
Thanks for the kind words! The task is a lot more complicated than it appears on the surface. I'm glad I made the task make a bit of sense to you!
@shawnbunch4872
@shawnbunch4872 7 ай бұрын
Clear, concise, and straight to the point. 🐐
@cameronmcnz
@cameronmcnz 7 ай бұрын
I do try my best to cover what's important. Nobody seems to want to hear my opinions on middle-east politics in these Git videos, it seems.
@vodka7924
@vodka7924 8 ай бұрын
You are a life saver sir, Thank you!!!
@cameronmcnz
@cameronmcnz 8 ай бұрын
Happy to help!
@ChiragYadav-w1d
@ChiragYadav-w1d 6 ай бұрын
Don't think there will be any other video which will explain it much better than you sir. Thank you
@cameronmcnz
@cameronmcnz 3 ай бұрын
Thanks so much for the kind words!
@samhkwest
@samhkwest 7 ай бұрын
Thanks for your demonstration. I've just used this tricks to fix a code merges issue for my work.
@cameronmcnz
@cameronmcnz 7 ай бұрын
Happy to have helped. Nothing worse than thinking you Git pushed something you shouldn't have and you're worried you've broken the build!
@kevindichter
@kevindichter 2 ай бұрын
You're a lifesaver! I thought I lost so much progress!
@mallenkb
@mallenkb Ай бұрын
You really saved me soo much time. Thank you
@cameronmcnz
@cameronmcnz Ай бұрын
Being a great dev is all about being able to find answers to your questions. You found the answer, you saved yourself. I just made a silly KZbin video. All the praise goes to you.
@mrjath4604
@mrjath4604 7 күн бұрын
Thank you so much, you explained everything in a simple way.
@ABDUL-REHMAN345
@ABDUL-REHMAN345 7 ай бұрын
Thankyou so much sir ! i'm watching a lot of video's but i don't understand....finally seeing your video and i will understand♥♥
@cameronmcnz
@cameronmcnz 7 ай бұрын
Thanks for watching! Honestly, once you get pulls, pushes and commits all under your belt, there's really not much more to being a true Git expert!
@joshlindsay87
@joshlindsay87 3 ай бұрын
Thank you. Best video I found which helped be roll back some AI destruction.
@cameronmcnz
@cameronmcnz 3 ай бұрын
Rolling back AI destruction is basically half of my job these days. Glad I could help!
@tencebakpao4820
@tencebakpao4820 2 ай бұрын
You are a hero! It worked like a charm
@amalkrishnas1696
@amalkrishnas1696 5 ай бұрын
thank you, great video
@TheIguana3d
@TheIguana3d 3 ай бұрын
You help me a lot, thank you so much!
@tamaritah2405
@tamaritah2405 3 ай бұрын
Thank you for that very good video. I did as you show but some of my new file sty when I revert to an older commit. why?
@cameronmcnz
@cameronmcnz 3 ай бұрын
When you revert an older commit, only the files that were part of that specific commit are 'rolled back.' And if it was just a file change, not a file creation or deletion, the file remains with just the changes inside of it rolled back. To take your entire workspace back to where it was 3 or 4 commits ago, you'd want to do a hard reset. Just be careful with a reset as it will mess up the repository if it's shared with others. If it's your own repo that's not shared, reset away!
@tamaritah2405
@tamaritah2405 3 ай бұрын
@@cameronmcnz thank you
@keifer7813
@keifer7813 5 ай бұрын
You're born to teach, man. Quick question though: What if the bad commit was the first and only commit? Then there's no commit hash before it to "git reset" to. Or is it still possible somehow? 🤔
@justin9494
@justin9494 8 ай бұрын
thank you so much!
@cameronmcnz
@cameronmcnz 8 ай бұрын
Happy to help! Which approach did you take? Revert the pushed commit or reset it?
@justin9494
@justin9494 8 ай бұрын
@@cameronmcnz kind of a bummer because I skipped the intro and didn't know there was a git revert after I've done git reset. I wanted to grab the code that didnt break my app but well, my fault for skipping. Thanks!
@cameronmcnz
@cameronmcnz 8 ай бұрын
@@justin9494 locally you can still find the orphaned commit created by the reset with the reflog command. Ten reset back to that and then do a revert. A lot of with though if what you’ve got works. Maybe I should make the intros shorter?
@utuberyder
@utuberyder 5 ай бұрын
Perfect one.
@cameronmcnz
@cameronmcnz 5 ай бұрын
Always happy the help. Thanks for watching!
@abujayed-dot-com
@abujayed-dot-com 7 ай бұрын
tnx, life saving.
@cameronmcnz
@cameronmcnz 7 ай бұрын
Meh, being a great dev means knowing how to find answers to your problems. You found it. You saved yourself. All I did was record a video.
@rosaal9030
@rosaal9030 5 ай бұрын
Sir can you please help me i use azuredev and I did revert from there and after that i go to visual studio code and I did git revert then again i did push . I mean i push the unwanted commit again what should I do
@gnmlna
@gnmlna 9 күн бұрын
Thank you!
@Snowdennnn01
@Snowdennnn01 8 ай бұрын
thanks. your video really helped me
@pclovers219
@pclovers219 8 ай бұрын
Sir when i pass the command git revert (commit id ) of any previous 3 or 4 commit it give me a merge conflict and in it there is a (current code ) but after ======== in the file there is nothing, no incoming change what can i do to go back to my previous state? Hope so you understand my problem 😂
@sagar.sreepuram1960
@sagar.sreepuram1960 8 ай бұрын
How to undo commit if we committ before push and get an error
@cameronmcnz
@cameronmcnz 8 ай бұрын
You can run into so many different scenarios. What's the error? I've probably run into it.
@cesarmta87
@cesarmta87 7 ай бұрын
Thank you!!!
@thakurj647
@thakurj647 28 күн бұрын
Too good.
@spacetabs
@spacetabs 4 ай бұрын
Using git reset with push -f (force) without understanding what you are doing, extremely bad things will happen.
@lolitaad19
@lolitaad19 4 ай бұрын
Thank you very much 🙏
@AhmedAbumughessib
@AhmedAbumughessib 22 күн бұрын
very helpful. thank you!
@cameronmcnz
@cameronmcnz 22 күн бұрын
I'm always here to help!
@mickey008ful
@mickey008ful 6 ай бұрын
Thank you a lot!
So You Think You Know Git - FOSDEM 2024
47:00
GitButler
Рет қаралды 1,3 МЛН
“Don’t stop the chances.”
00:44
ISSEI / いっせい
Рет қаралды 17 МЛН
小丑女COCO的审判。#天使 #小丑 #超人不会飞
00:53
超人不会飞
Рет қаралды 8 МЛН
Git Branches Tutorial
33:20
freeCodeCamp.org
Рет қаралды 254 М.
Git and GitHub Crash Course For Beginners | Complete Tutorial [2024]
1:53:19
How to be a git expert
46:26
Floating Little Leaves of Code
Рет қаралды 174 М.
How to finally Git Good
9:43
Code Persist
Рет қаралды 75 М.
Git & GitHub Crash Course For Beginners
32:42
Traversy Media
Рет қаралды 3,1 МЛН
Learn Git and GitLab Tutorial For Beginners | Full Course [2024]
1:44:09
Cameron McKenzie
Рет қаралды 15 М.
GitHub Actions Tutorial - Basic Concepts and CI/CD Pipeline with Docker
32:31
TechWorld with Nana
Рет қаралды 1,6 МЛН
How GIT works under the HOOD?
16:01
Tech With Nikola
Рет қаралды 207 М.
“Don’t stop the chances.”
00:44
ISSEI / いっせい
Рет қаралды 17 МЛН