How to revert a commit in git after push in terminal | 1 min. GitHub tutorial

preview_player
Показать описание
This quick tutorial shows you how to revert a commit after push. It shows you how to revert a merge commit with git revert -m 1 [hash], which is only for merge commits. To revert a regular commit, a non-merge commit, just use git revert [hash].

I often find that simple directions for how to revert a commit in GitHub online are full of convoluted info -- this video serves as a quick guide to revert a commit, especially when things suddenly go wrong and you need to undo a commit, ASAP! This video shows you how to use GitHub UI to identify which commit hash or id to use with git revert. It is possible to retrieve the correct hash in the terminal with git log, but I prefer to use the UI -- easier to navigate, understand, and look at.

I make quick tutorials for the basic problems we often run into as developers. Thank you for the thumbs up!! Have a good day!!
Рекомендации по теме
Комментарии
Автор

Pushed some bad code at work and was stuck for hours trying to figure out how to revert it - this video helped immensely. thank you!!

griffincarter
Автор

Very short and very simple. Love it, Thanks!
By the way, I used the "git revert -m 1 [hash]" on a regular commit and it still worked.

thegoatmachine
Автор

these 1 min tutorials are such a great idea ! :D

processorbot
Автор

I almost deleted all my files 🤯, but glad it was on staged file. For a second I was dead, lol. These small videos are great and hard to find. Keep going!

rohitagrawal
Автор

Thanks for making that so easy to.understand. I appreciate the efficient knowledge transfer.

jlmobley
Автор

Thanks straight to the point, you earned a sub!

Voyage
Автор

Thank you so much! You really helped me solve a big problem.

mohammedvahith
Автор

Thanks!!! Really quick and easy! Great idea!

vladimirgorea
Автор

Thank you for making this video. It helped a lot!

hasbealam
Автор

You are amazing !! Love your work and yeah your smile too, Great work !!!!

moubiswasEdits
Автор

thank you for clarifying reverting for merged commit 🙏

khaledhelwane
Автор

Is that it? That simple? Wow! 😊 you just earned a sub

bhongosinxo
Автор

Thank you actually you solved my big problem

zalakeprasad
Автор

Thanks, was sweating over the commits

marufhassan
Автор

so you have to clone that repo into your local machine first? so that you can do the command prompt stuff

im looking for an alternative that can rever back to previous commit RIGHT ON THE WEB, is there any way?

catorlife
Автор

Can you please make a video on how to retrive code in to feature branch and How to do Base Commit ? I didnt find anywhere that solution.

jigneshpanchal
Автор

Helped a lot in just a min... Arigato Gozaimasu!!!

parzival_rex_
Автор

hi. thank for your tutorial but I has a error. when i use command : git revert [hash], there is an error : fatal: bad revision . Please. Help me!. Thank you very much!

phucphamthanh
Автор

Is this reverting back to the commit of the id, or is it reverting all the changes made in that id?

mr_clean
Автор

whay about changes in github without ide

thgqezb