Demonstrate a hard reset Git


show more Demonstrating a hard reset provides you with in-depth training on Developer. Taught by Kevin Skoglund as part of the Git Essential Training show less
please wait ...

Demonstrating a hard reset

In the last two movies we've taken a look at a soft reset and a mixed reset. In this movie we're going to take a look at the hard reset, or a Git reset using the hard option. Now, of the three this is the most destructive, because all three of them rewind the HEAD pointer to point to another commit, but the other two leave the files either in our staging index or in our working directory so that we then have those changes still at hand ready to remake those commits. The hard reset doesn't do that.

Hard reset makes our staging index and our working directory exactly match the repo. It throws out everything that happened after that. Those commits are not just sitting there waiting for us to recommit, we're now essentially rewound back to that previous commit. That makes it the easiest way for you to lose data. The main time that you want to use a git reset hard is when things have really just gotten out of hand in your working directory, they're just completely out of sync, that'...

Demonstrating a hard reset
Video duration: 5m 8s 6h 25m Beginner

Viewers:

Demonstrating a hard reset provides you with in-depth training on Developer. Taught by Kevin Skoglund as part of the Git Essential Training

Subject:
Developer
Software:
Git GitHub
Author:
please wait ...