From the course: Coding Exercises: Git
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Creating a safety net for fixes - Git Tutorial
From the course: Coding Exercises: Git
Creating a safety net for fixes
(beeping) (upbeat music) - [Instructor] Let's say that you valiantly did a git reset with the hard flag and then panic strikes. You realize that you didn't mean to do that. Is there a way to undo a hard reset? I'll give you a couple of seconds to think about how you would do something like this. (beeping) (upbeat music) Now have no fear, advanced users of git know that there is another way to get out of a hard reset. So let's take a look at our git log. We'll do a git log one line here. And you'll see that my log shows a number of different commits, and let's just find a commit that is way farther back and we'll do a hard reset here. So let's clear this out, and we'll do a git reset, and the hard flag will let us rewind to this particular commit. So now we're back somewhere in our history, and if I do another git log, one line here, you'll see that my earlier history is now gone. So I used to think that there is…
Contents
-
-
-
Cloning with limited history1m 33s
-
(Locked)
Adding to a previous commit4m 36s
-
(Locked)
Identifying your changes2m 26s
-
(Locked)
Managing multiple remotes2m 42s
-
(Locked)
Cleaner logs3m 25s
-
(Locked)
Using Git to hunt down bugs5m 7s
-
(Locked)
Working on multiple branches3m 19s
-
(Locked)
Creating a .zip file2m 57s
-
(Locked)
Getting rid of quick fixes4m 48s
-
(Locked)
Marking items without branching4m 8s
-
(Locked)
Removing untracked files2m 44s
-
(Locked)
Renaming branches2m 31s
-
(Locked)
Remove local, keep master3m 15s
-
(Locked)
Picking specific commits4m 30s
-
(Locked)
Creating a safety net for fixes2m 51s
-