How to Undo Mistakes With Git Using the Command Line

preview_player
Показать описание
Git offers lots of different ways to undo, revert, recover and fix your mistakes. In this course, we'll look at the bad things that can happen to you - and how Git can save your neck.

Note: This course focuses on using Git with the command line. You do not need Tower or any other GUI software to follow along.

⭐️ Course Contents ⭐️
⌨️ (00:00) Introduction
⌨️ (00:54) Hosted by Tower
⌨️ (01:29) Git as your safety net
⌨️ (02:50) Discard all local changes in a file
⌨️ (04:28) Please be careful: discarding local changes cannot be undone!
⌨️ (05:03) Restoring deleted files
⌨️ (06:10) Discard chunks / lines in a file
⌨️ (10:22) Discarding all local changes
⌨️ (11:42) Fixing the last commit
⌨️ (14:53) What "rewriting history" means
⌨️ (15:54) Reverting a commit in the middle
⌨️ (18:48) Resetting to an old revision
⌨️ (21:48) Resetting a file to an old revision
⌨️ (23:59) The Reflog
⌨️ (24:38) Recovering deleted commits
⌨️ (27:46) Recovering deleted branches
⌨️ (31:22) Moving a commit to a new branch
⌨️ (33:55) Moving a commit to a different branch
⌨️ (35:57) Interactive Rebase: an overview of what you can do
⌨️ (37:54) Interactive Rebase: how it works in general
⌨️ (38:36) Editing old commit messages with Interactive Rebase
⌨️ (41:29) Deleting commits with Interactive Rebase
⌨️ (43:20) Squashing multiple commits into one with Interactive Rebase
⌨️ (46:00) Adding changes to an old commit with Interactive Rebase
⌨️ (51:54) Splitting/editing an old commit with Interactive Rebase
⌨️ (54:01) Reminder: don't rewrite commits that you have already shared!

⭐️ Special thanks to our Champion supporters! ⭐️
🏆 Loc Do
🏆 Joseph C
🏆 DeezMaster

--

Комментарии
Автор

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

saishashank
Автор

This video saved me! About 2 weeks ago I deleted a commit and tried everything to could think to get it back. Discovering git reflog, then resetting or creating a new branch from that commit is exactly what I needed. And voilà, all work restored after many sleepless nights. THANK YOU SO MUCH!

angelajholden
Автор

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

harshadpandit
Автор

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.

dolusdirectu
Автор

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

moali
Автор

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

gubazoltan
Автор

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

moai
Автор

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

bishnukumarbhakat
Автор

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

treequin
Автор

thanks for the course and for making it freely available.

dlopezlo
Автор

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

rafaelmrantunes
Автор

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

davidtang
Автор

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

sanskaarpatni
Автор

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

josearevalo
Автор

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.

Dgiulian
Автор

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

bouamarelouahhabi
Автор

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

compScientizt
Автор

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

dipenparmar
Автор

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

ventin
Автор

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.

privatename