A hard reset permanently undoes changes and discards the code.
- [Instructor] Now that we know about soft and mixed resets, … we're ready to learn about hard resets. … Hard resets move the head pointer, … they change the staging index to match the repository … and they change the working directory … to match the repository. … We call it, the same way we've called the others … using git reset with dash dash hard followed by a tree-ish. … Now a hard reset is going to return to an old state … and discard all subsequent code changes. … It's useful to permanently undo commits, … to make a branch look like something different completely. … So previous commits and all changes will be discarded. … That's why it's called a hard reset, … it's the toughest one. … And the same caveats apply. … Be careful about amending commits which have been shared, … because once you share code … their repository's are still going to have commits, … and yours won't, and it becomes hard to sync things … back up again. … Let's try a hard reset. … I'm inside my explore California project …
- Finding and viewing commits
- Creating and switching branches
- Comparing branches
- Resetting branches
- Merging branches
- Stashing uncommitted changes
- Setting up a remote repository
- Creating remote branches
- Fetching and pushing changes to a remote
- Enabling remote collaboration
Skill Level Beginner
1. Navigate the Commit Tree
3. Reset Branches
4. Merge Branches
5. Stash Changes
6. Set Up a Remote
7. Collaborate with a Remote
Next steps3m 40s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.