A soft reset moves the HEAD pointer without changing other files.
- [Instructor] Let's learn how to perform a soft reset … and see why you might find it useful. … As we've seen soft reset moves the HEAD pointer, … it does not change the staging index, … and it does not change the working directory, … and the way that you call a soft reset … is just to type git reset … and then use the dash dash soft option followed … by a tree-ish which could either be a SHA from a commit … or a branch name or a tag name or something else, … anything that points to some point … in the repository's timeline. … So why would you use a soft reset? … You use it to return to an old state, … but leave code changes staged, that makes it useful … for amending one or more commits. … We're saying let's roll back in time, … but let's hold onto those changes and let's keep them … in the staging area and in the working directory … as if they're just not committed yet. … It's a little bit similar to git commit amend. … Now it's important to note that any time … we do a reset previous commits will be discarded. …
- 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.