How to Undo Mistakes With Git Using the Command Line

แชร์
ฝัง
  • เผยแพร่เมื่อ 6 ต.ค. 2024

ความคิดเห็น • 82

  • @saishashank1000
    @saishashank1000 3 ปีที่แล้ว +73

    I wished I could undo mistakes that I made in my life by using git :’)

    • @thengakola6217
      @thengakola6217 3 ปีที่แล้ว +2

      F

    • @bishnukumarbhakat4892
      @bishnukumarbhakat4892 3 ปีที่แล้ว +2

      Yes! you can, by following up DRY principle.

    • @ms711x
      @ms711x 3 ปีที่แล้ว +2

      You can but you need admin privileges.

    • @Arun-bz4jr
      @Arun-bz4jr 3 ปีที่แล้ว

      do it better next time, do not "commit" more mistakes :-)

    • @fwang3695
      @fwang3695 3 หลายเดือนก่อน

      did you commit?

  • @harshadpandit5483
    @harshadpandit5483 2 ปีที่แล้ว +2

    Probably the most important topic on GIT explained in the most simplest way. Awesome.

  • @dolusdirectu
    @dolusdirectu 2 ปีที่แล้ว +5

    Wow, amazing tutorial. After reading the git documentation I was really confused about some topics but this lesson made it clear to me. I really appreciate it thx for the great content.

  • @ninjababy1997
    @ninjababy1997 3 ปีที่แล้ว +3

    Really good video. On git restore -p enter "?" and git will show you the following:
    y - discard this hunk from worktree
    n - do not discard this hunk from worktree
    q - quit; do not discard this hunk or any of the remaining ones
    a - discard this hunk and all later hunks in the file
    d - do not discard this hunk or any of the later hunks in the file
    s - split the current hunk into smaller hunks
    e - manually edit the current hunk
    ? - print help

  • @Dgiulian
    @Dgiulian 3 ปีที่แล้ว +5

    Another good tip is when we have worked on a file but want to commit only parts of it, we can use the -p option to decide which lines should and shouldn't be staged.

  • @moali2990
    @moali2990 2 ปีที่แล้ว

    Not exaggerating, you are a gift from heaven, currently having problems with bad merges with master branch. This is helping me alot

  • @rafaelmrantunes
    @rafaelmrantunes ปีที่แล้ว +1

    That's a must-see for sure. Thanks for the content. Valuable af

  • @moai545
    @moai545 3 ปีที่แล้ว +3

    Thank you for giving me a very detailed and very easy-to-understand explanation!!! RESPECT!!! 🙏

  • @je9625
    @je9625 6 หลายเดือนก่อน

    I have no idea why it took me three years to come across this video. It's a gem 🎉

  • @gubazoltan99
    @gubazoltan99 3 ปีที่แล้ว

    Immediately added this video to my favourites. Thanks for the clear explanation!

  • @ventin75
    @ventin75 ปีที่แล้ว +1

    Great video. I like how you presented the use cases.

  • @dlopezlo
    @dlopezlo 3 ปีที่แล้ว

    thanks for the course and for making it freely available.

  • @treequin
    @treequin ปีที่แล้ว

    Very good tutorial! Learned quite a few things watching it. Thanks for making it!

  • @bishnukumarbhakat4892
    @bishnukumarbhakat4892 3 ปีที่แล้ว

    Thank you for this drive, really it was an awesome tour to stack up the real base of "git".

  • @ozzy9846
    @ozzy9846 3 ปีที่แล้ว +4

    Git is such an amazing tool!

  • @sanskaarpatni9137
    @sanskaarpatni9137 3 ปีที่แล้ว

    This video is so goood! Important stuff af:
    I had seen the video when it came out..
    But yesterday when I ran into a problem I realized I should see this video again properly

  • @KrishnaKumar-ks3mj
    @KrishnaKumar-ks3mj 8 หลายเดือนก่อน

    The one I was looking for a while, which resolves all the doubts so professionally :)

  • @dipenparmar2273
    @dipenparmar2273 3 ปีที่แล้ว +1

    Excellent job, Great for experts as well beginners....

  • @JeanCarlos-km3vz
    @JeanCarlos-km3vz 3 ปีที่แล้ว +1

    Great explanation!
    Boom! Not panic anymore!

  • @ashaalex
    @ashaalex 3 ปีที่แล้ว +1

    Very well explained.. Thank you very much

  • @bouamarelouahhabi9525
    @bouamarelouahhabi9525 3 ปีที่แล้ว +2

    I remember your voice from gitower tutorials :), thanks for the good job!

  • @privatename3621
    @privatename3621 2 ปีที่แล้ว

    Fantastic video. And very comprehensive. Only thing is that you never gave the CLI commands for the last exercise, "Splitting / Editing and Old Commit." I took good notes on everything else. Thanks for this post.

  • @PedroRoldao3
    @PedroRoldao3 6 หลายเดือนก่อน

    Awesome video. Very gut explained and very helpfull tools. Thank you

  • @humayunakhtar2116
    @humayunakhtar2116 3 ปีที่แล้ว

    Oh Man I'm so happy to learn multiple things in this video

  • @compScientizt
    @compScientizt 2 ปีที่แล้ว

    You are awesome indeed. thanks alot!😍🙏 Thanks for providing such a crucial knowledge for free.

  • @blasttrash
    @blasttrash 3 ปีที่แล้ว +1

    awesome tutorial

  • @dinobulja
    @dinobulja 3 หลายเดือนก่อน

    soooo useful, thank you!!!

  • @josearevalo3817
    @josearevalo3817 3 ปีที่แล้ว

    The video is in my the top 10! Thanks! 👍🏼

  • @davidtang1828
    @davidtang1828 3 ปีที่แล้ว

    This was awesome. Thank you! Definitely will be checking out Tower now lol.

  • @babalolajnr
    @babalolajnr 3 ปีที่แล้ว

    Nice. Been looking for this forever

  • @muhammadtalhabaig1725
    @muhammadtalhabaig1725 ปีที่แล้ว

    Thank you bro!

  • @JasonHuebel
    @JasonHuebel 3 ปีที่แล้ว

    Great information. Thanks for sharing.

  • @shubhamdandekar20
    @shubhamdandekar20 3 ปีที่แล้ว +2

    Useful one.

    • @freecodecamp
      @freecodecamp  3 ปีที่แล้ว

      If you are brand new to git, start with this video: th-cam.com/video/RGOj5yH7evk/w-d-xo.html

  • @JasonHuebel
    @JasonHuebel 3 ปีที่แล้ว +1

    11:30 That's my biggest concern, git restore doesn't ask for confirmation. While I'm OK with that in other cases, when you are discarding changes, I feel like git should err on the side of caution.

  • @mustafaaljanabi4818
    @mustafaaljanabi4818 3 ปีที่แล้ว +3

    please I want a full course talks about HTML, CSS, and JS all of them are standard version like not html5 or css3 or something. Thanks!

  • @cyril7104
    @cyril7104 3 ปีที่แล้ว

    The most usefull lesson, big thx!

  • @samplesample-b8c
    @samplesample-b8c 9 หลายเดือนก่อน

    Helpful sir thanks

  • @mei2508
    @mei2508 3 ปีที่แล้ว

    Exactly what I need!TY

  • @orafasistemas
    @orafasistemas 2 ปีที่แล้ว

    Thank you.

  • @hajarelmajid6842
    @hajarelmajid6842 3 ปีที่แล้ว +6

    I've read it as how to do mistakes with Git and even with that I clicked never have blindly trust a channel like that!

  • @AmitBiswastunebox
    @AmitBiswastunebox ปีที่แล้ว

    Here is the scenario, I created a branch from "develop" branch, then I created my PR against "develop". Code reviewer reviewed and Approved. Then I merged my branch (PR) with with "develop". I have have couple changes for example , commit A, B, C. so on. I just don't want changed " commit B". How to undo that form the merged PR and "develop" branch should nor have that "commit B"

  • @jcavelez
    @jcavelez 3 ปีที่แล้ว

    Genial. Muchas gracias.

  • @konstantinrebrov675
    @konstantinrebrov675 3 ปีที่แล้ว +2

    A like for a comprehensive overview of all the different possible things one can do in git to fix your mistakes.
    But a dislike for using a GUI tool almost half of the time. You should have used git status and git log to find information about the commit history. And you also used the GUI tool to checkout different branches, and even do cherry-pick! I'm not necessarily against using GUI tools, but the title of your video is "How to Undo Mistakes With Git Using the Command Line
    ". It implies that you will not use any GUI tools, only Using the Command Line! If instead you would have used Command Line ONLY and not used the GUI tool, it would have made explaining the actual git commands better. I think that using the GUI tool is less clear about what is actually going on. It is better to use the actual Command Line to explain how git works, especially since that's the title of your video!

  • @harryjohn6736
    @harryjohn6736 ปีที่แล้ว

    Please provide link to your complete course.

  • @zain.sadaqat
    @zain.sadaqat 2 ปีที่แล้ว

    Nobody covered these git commands before. Thanks a lot!
    Can someone please tell me what are the commands for case # 17 at 54:01

  • @sakshamkshatri9649
    @sakshamkshatri9649 3 ปีที่แล้ว +4

    Never been sooooo early!!

  • @Megaheropap
    @Megaheropap 3 ปีที่แล้ว +1

    Yes

  • @mohitjoc25
    @mohitjoc25 3 ปีที่แล้ว

    Make advance full course on c++ with project

  • @afrobear2310
    @afrobear2310 3 ปีที่แล้ว

    never been so late !!!!

  • @amitkumarjena3184
    @amitkumarjena3184 3 ปีที่แล้ว

    Voila!

  • @candi2Love
    @candi2Love 3 ปีที่แล้ว

    How many 'CTRL Z' is allowed in Tower?

  • @bestchoice7431
    @bestchoice7431 ปีที่แล้ว

    git restore . command do not work for deleting the untracked or unstaged files. Can we use git clean -fdx ?

  • @ashirwadsharma5462
    @ashirwadsharma5462 3 ปีที่แล้ว

    git restore is not finding as a command. What would be problem??

  • @imkir4n
    @imkir4n 3 ปีที่แล้ว

    Im bsc cs student and its project time...could you please mention some projects with tutorials bcs many project centers approach me with expensive fees...i can't afford it...help me guys

  • @OfficialOceaneMusic
    @OfficialOceaneMusic 3 ปีที่แล้ว

    Question:
    1)when you squash two commit into one is it ok to delete the parents of that new commit

  • @ankurgupta5976
    @ankurgupta5976 3 ปีที่แล้ว

    This is a missing guide of my git journey.

  • @RTX_valorant
    @RTX_valorant 3 ปีที่แล้ว

    hi freecodecamp is it possible can we get ppt?

  • @DragonStoneCreations
    @DragonStoneCreations 3 ปีที่แล้ว

    ❤️

  • @vietnamneko611
    @vietnamneko611 3 ปีที่แล้ว +16

    my parents:

  • @pppluronwrj
    @pppluronwrj 3 ปีที่แล้ว

    delete folder then clone again

    • @eniluck5071
      @eniluck5071 3 ปีที่แล้ว

      Use RAR instead....

  • @chikaonyema2522
    @chikaonyema2522 3 ปีที่แล้ว

    Wow

  • @richardbajuzik2445
    @richardbajuzik2445 3 ปีที่แล้ว +1

    Just use SmartGIT :D

  • @nordicnomad5473
    @nordicnomad5473 ปีที่แล้ว

    🎉

  • @thecscontent5110
    @thecscontent5110 3 ปีที่แล้ว

    I also do videos about programming!😁

  • @anubhavmukherjee3488
    @anubhavmukherjee3488 3 ปีที่แล้ว +1

    Second

  • @brunoribaric9683
    @brunoribaric9683 3 ปีที่แล้ว +1

    "Using the command line" is an unnecessary addition to the title, given that a quite relevant portion of the video shows off his GUI tool.

    • @sujithkumar824
      @sujithkumar824 3 ปีที่แล้ว +3

      This is why I hate people, the entire video is free, it shows everything how to do as it claims using CLI, but you still had to comment to spread negativity somehow and pointed him showing his GUI tool to make the unrelated parts faster.

  • @RaySuliteanu
    @RaySuliteanu 2 หลายเดือนก่อน

    I like the topic but I don’t like the use of gittower. The whole point and title of the video was using the command line. But over and over you switched to gittower. Everything should have been done on the command line. Otherwise it defeats the purpose as well as becomes an advertisement for gittower.

  • @thatinstant
    @thatinstant 7 หลายเดือนก่อน

    This video is good, but not great. What would make this video great is not shamelessly promoting that GUI app and sticking to demonstrating all scenarios with the commandline, just as the title of this video suggests. The presenter gets lazy by scenario #11 and doesn't demonstrate the commandline tasks, and only shows a summary of the commands at the end of the scenario. This is the problem with GUI apps, they make you lazy.

  • @이건개발-p8n
    @이건개발-p8n 3 ปีที่แล้ว

    $ git restore .

  • @buttnomaan
    @buttnomaan 2 ปีที่แล้ว

    great video

  • @greob
    @greob 3 ปีที่แล้ว +7

    Git Tower looks nice, but it's not available for GNU/Linux, so I'll stick with command line.

    • @iliyalb
      @iliyalb 3 ปีที่แล้ว

      Use GitKraken

  • @michaeltarassov940
    @michaeltarassov940 3 ปีที่แล้ว

    Thanks a lot, it was great!