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

  Рет қаралды 21,092

Cameron McKenzie

Cameron McKenzie

Күн бұрын

Пікірлер: 70
@Spyros.Charalambous
@Spyros.Charalambous 9 ай бұрын
It's the most simplified video ever! thank you so much for your time!!!
@cameronmcnz
@cameronmcnz 9 ай бұрын
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. 👍
@Lucy-m9b3y
@Lucy-m9b3y Ай бұрын
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 Ай бұрын
You are most welcome. And thanks for watching. May the force be with you.
@readmyheart
@readmyheart 5 ай бұрын
that intro... this guy's about to save my life. thanks in advance!
@cameronmcnz
@cameronmcnz 5 ай бұрын
Nobody gets out alive, I'm afraid. Thanks for watching and commenting!
@jeetendranavgikar6384
@jeetendranavgikar6384 8 ай бұрын
After watching so many videos for the solution. this video got it right. thank you
@cameronmcnz
@cameronmcnz 8 ай бұрын
Why would you watch someone else's video? Happy to help!
@matk2283
@matk2283 Ай бұрын
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 Ай бұрын
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!
@pravinprince3221
@pravinprince3221 10 ай бұрын
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 10 ай бұрын
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.
@Shahroze_
@Shahroze_ 2 ай бұрын
Genuinely the best video I've watched for this scenario. Appreciate it!
@cameronmcnz
@cameronmcnz 2 ай бұрын
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 8 ай бұрын
Clear, concise, and straight to the point. 🐐
@cameronmcnz
@cameronmcnz 8 ай бұрын
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 9 ай бұрын
You are a life saver sir, Thank you!!!
@cameronmcnz
@cameronmcnz 9 ай бұрын
Happy to help!
@kevindichter
@kevindichter 3 ай бұрын
You're a lifesaver! I thought I lost so much progress!
@mallenkb
@mallenkb 2 ай бұрын
You really saved me soo much time. Thank you
@cameronmcnz
@cameronmcnz 2 ай бұрын
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.
@ChiragYadav-w1d
@ChiragYadav-w1d 8 ай бұрын
Don't think there will be any other video which will explain it much better than you sir. Thank you
@cameronmcnz
@cameronmcnz 4 ай бұрын
Thanks so much for the kind words!
@mytube2581
@mytube2581 4 ай бұрын
Thanks
@cameronmcnz
@cameronmcnz 4 ай бұрын
Wow! I'm always here to help, and for you, twice as much!
@samhkwest
@samhkwest 8 ай бұрын
Thanks for your demonstration. I've just used this tricks to fix a code merges issue for my work.
@cameronmcnz
@cameronmcnz 8 ай бұрын
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!
@mrjath4604
@mrjath4604 Ай бұрын
Thank you so much, you explained everything in a simple way.
@maurolimaok
@maurolimaok 11 сағат бұрын
Nice channel. I'm learning to code at Odin Project, and all this videos will be very useful Thanks, a lot.
@tencebakpao4820
@tencebakpao4820 3 ай бұрын
You are a hero! It worked like a charm
@ChanceTEK
@ChanceTEK Ай бұрын
Invaluable info. Thank you.
@cameronmcnz
@cameronmcnz Ай бұрын
You gotta do this the right way or you're in trouble.
@ABDUL-REHMAN345
@ABDUL-REHMAN345 9 ай бұрын
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 8 ай бұрын
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 4 ай бұрын
Thank you. Best video I found which helped be roll back some AI destruction.
@cameronmcnz
@cameronmcnz 4 ай бұрын
Rolling back AI destruction is basically half of my job these days. Glad I could help!
@keifer7813
@keifer7813 6 ай бұрын
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? 🤔
@TheIguana3d
@TheIguana3d 4 ай бұрын
You help me a lot, thank you so much!
@tamaritah2405
@tamaritah2405 4 ай бұрын
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 4 ай бұрын
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 4 ай бұрын
@@cameronmcnz thank you
@abdel-khafid
@abdel-khafid 10 күн бұрын
Great video ! Thanks !
@cameronmcnz
@cameronmcnz 10 күн бұрын
Happy to help! Have great 2025!
@xr_xharprazoraxtra5428
@xr_xharprazoraxtra5428 21 сағат бұрын
instead of using comand prompts or terminals, how to do it on the Github Website ?
@amalkrishnas1696
@amalkrishnas1696 6 ай бұрын
thank you, great video
@Snowdennnn01
@Snowdennnn01 9 ай бұрын
thanks. your video really helped me
@rosaal9030
@rosaal9030 6 ай бұрын
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
@pclovers219
@pclovers219 9 ай бұрын
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 10 ай бұрын
How to undo commit if we committ before push and get an error
@cameronmcnz
@cameronmcnz 9 ай бұрын
You can run into so many different scenarios. What's the error? I've probably run into it.
@justin9494
@justin9494 9 ай бұрын
thank you so much!
@cameronmcnz
@cameronmcnz 9 ай бұрын
Happy to help! Which approach did you take? Revert the pushed commit or reset it?
@justin9494
@justin9494 9 ай бұрын
@@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 9 ай бұрын
@@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 6 ай бұрын
Perfect one.
@cameronmcnz
@cameronmcnz 6 ай бұрын
Always happy the help. Thanks for watching!
@abujayed-dot-com
@abujayed-dot-com 8 ай бұрын
tnx, life saving.
@cameronmcnz
@cameronmcnz 8 ай бұрын
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.
@gnmlna
@gnmlna Ай бұрын
Thank you!
@cesarmta87
@cesarmta87 8 ай бұрын
Thank you!!!
@thakurj647
@thakurj647 Ай бұрын
Too good.
@spacetabs
@spacetabs 5 ай бұрын
Using git reset with push -f (force) without understanding what you are doing, extremely bad things will happen.
@lolitaad19
@lolitaad19 5 ай бұрын
Thank you very much 🙏
@AhmedAbumughessib
@AhmedAbumughessib Ай бұрын
very helpful. thank you!
@cameronmcnz
@cameronmcnz Ай бұрын
I'm always here to help!
@96bluessky
@96bluessky 29 күн бұрын
Thank you very much!
@mickey008ful
@mickey008ful 8 ай бұрын
Thank you a lot!
How to create new branch in GitHub?
5:00
AyyazTech
Рет қаралды 19 М.
СИНИЙ ИНЕЙ УЖЕ ВЫШЕЛ!❄️
01:01
DO$HIK
Рет қаралды 3,3 МЛН
coco在求救? #小丑 #天使 #shorts
00:29
好人小丑
Рет қаралды 120 МЛН
UFC 310 : Рахмонов VS Мачадо Гэрри
05:00
Setanta Sports UFC
Рет қаралды 1,2 МЛН
Правильный подход к детям
00:18
Beatrise
Рет қаралды 11 МЛН
So You Think You Know Git - FOSDEM 2024
47:00
GitButler
Рет қаралды 1,3 МЛН
Git revert vs reset: What's the difference?
8:15
Cameron McKenzie
Рет қаралды 6 М.
How to Undo Mistakes With Git Using the Command Line
55:21
freeCodeCamp.org
Рет қаралды 86 М.
What’s the better Git? // GitLab vs Gitea
13:31
Christian Lempa
Рет қаралды 20 М.
How to finally Git Good
9:43
Code Persist
Рет қаралды 76 М.
git rebase - Why, When & How to fix conflicts
9:45
Philomatics
Рет қаралды 69 М.
10 Must Know Git Commands That Almost Nobody Knows
15:22
Web Dev Simplified
Рет қаралды 96 М.
Everything You'll Need to Know About Git with ThePrimeagen | Preview
14:43
СИНИЙ ИНЕЙ УЖЕ ВЫШЕЛ!❄️
01:01
DO$HIK
Рет қаралды 3,3 МЛН