“Git undo” or the art of rolling back by Delicious Insights

“Git undo” or the art of rolling back

Relax! Git makes it easy to get back seemingly lost work and dig yourself out of even the most delicate situations.

Always land back on your feet!

In trouble? Staged too many things, or even committed undue stuff? Do you need to cancel commits, or squash them into one, or split them, turn them into their own branch, or outright rollback a faulty merge or rebase, or what not? This is the course for you!

The amazing thing with Git is, there is always a quick, clean way of digging yourself out from any issue you stumble onto. Internalizing this is extremely liberating as you know there’s always a way out: you are thus free to experiment and move fast. Now that’s not something you can say about many versioning systems, is it?

You’ll get…

Video Icon 30 videos File Icon 2 files Text Icon 1 text file

So what’s in the course?

All videos in one download
627 MB
All sample repos in one download
1.02 MB
Welcome!
2 mins
Undoing ongoing edits ✋
Undoing an edit to the working copy
4 mins
Undoing an edit to the index and working copy
2 mins
Undoing an edit to the index only
4 mins
Undoing commits🧞‍♂️
Still with reset but…
4 mins
The --soft and --mixed modes
5 mins
Differences between --keep, --merge and --hard
4 mins
The --keep mode
2 mins
The --merge mode
2 mins
The --hard mode
2 mins
So this is swell, but how about some actual use cases? 🤔
You can (un)do pretty much anything
2 mins
I committed too fast
4 mins
Splitting my latest commit
3 mins
Squashing recent commits as one
3 mins
I should have branched off sooner
3 mins
Wiping the slate clean
2 mins
Undoing is neat, but can I “redo” if I screw up? 😨
Sure you can: the reflog remembers what you forgot
3 mins
Log vs Reflog
1 min
How is our reflog built from the HEAD?
6 mins
How is our reflog built from branch tips?
3 mins
So I can never lose anything, right?
1 min
reflog + reset: back to the future
2 mins
Works with everything! 🦄
commit, reset, merge, rebase, pull…
1 min
Undoing a merge
4 mins
Undoing a rebase
6 mins
Undoing a pull
1 min
Undoing a merge-mode pull
4 mins
Undoing a rebase-mode pull
2 mins
Git revert: not so fast! 🤢
Git revert carelessly pollutes the history
2 mins
And we’re done! 😭
Want more video courses?
2 mins
Further reading…

Animated diagrams galore

To make sure it all clicks for you, Maxime spared no effort crafting wonderful animated diagrams. You’ll see how efficient this is to finally bring some light and clarity!

FAQs

😎 Should I already know Git?

You would preferably already have some Git experience, yes, otherwise you’ll have a harder time picturing yourself in the situations we describe to best understand how valuable the solutions we present are.

🎁 Do you provide the code samples too?

Of course we do! Every section opening has a link to a Zip file with all the sample repositories for that section, ready for your own trials and tweaks.

📥 Can I download the videos for offline viewing?

Yes! Every section opening contains a link to a Zip file with all the MP4 video files for that section, that you can download to view or review when you’re offline. Note that a low bandwidth is enough to watch them online, though, and that gets you extras like transcripts and related contents.

🆓 Do you offer other free Git-related content?

Do we ever! Our tech articles on Git are many and in-depth; you'll also find a number of videos from our conference talks or meetups about Git and how to streamline your workflows with it. Some examples:

🎓 Do you do in-room trainings?

We sure do! We probably offer one of the world’s best Git trainings: 360° Git. 3 days to explore Git in-depth, from scratch, unlocking all its power and with tons of hands-on practical exercises.

A course by Maxime

Maxime Bréhin has been using Git daily since 2008, and has been a professional trainer on it since 2015. An expert on Git and on the productivity and workflow boosts it enables, Maxime gives you all the keys here to understand the underpinnings of Git commands and its reset and checkout behaviors so you can confidently undo anything you come across.