YoVDO

How to Undo Git Commits, Rename a Git Branch and Checkout a Previous Commit

Offered By: Dave Gray via YouTube

Tags

Git Courses Version Control Courses

Course Description

Overview

Learn essential Git commands and techniques in this comprehensive tutorial video. Master undoing commits, renaming branches, and checking out previous commits. Explore practical examples of restoring files, amending commit messages, creating and managing branches, handling merge conflicts, and reverting or resetting code to specific commit points. Gain valuable skills to effectively navigate and control your Git workflow, enhancing your version control capabilities for more efficient software development.

Syllabus

Recap Quick Start
git restore [filename] undo changes
git restore --staged [filename] undo staged files
git log show log with details
git log --oneline shows simplified log
git commit -v --amend change last commit's message
git branch [newBranchName] creates new branch
git branch --list lists all branches
git checkout [branchName] switch to this branch
working with more than one branch
git branch -m [oldBranchName] [newBranchName] renames branch
git checkout -b [newBranchName] creates new branch and switches to it
git branch -D [branchName] deletes branch permanently
git merge [branchName] merges named branch into branch you are on
Understanding and handling git merge conflicts
git checkout [commitNumber] go back to a specific commit number
git revert [commitNumber] revert code to a specific commit number by creating new commit
git reset [commitNumber] reset code to a specific commit number and unstage the code that came after that commit
git reset [commitNumber] --hard reset code to a specific commit and permanently delete the code that came after the commit


Taught by

Dave Gray

Related Courses

The Data Scientist’s Toolbox
Johns Hopkins University via Coursera
How to Use Git and GitHub
Udacity
Ruby on Rails: An Introduction
Johns Hopkins University via Coursera
Accediendo a la nube con iOS
Tecnológico de Monterrey via Coursera
Responsive Website Development and Design Capstone
University of London International Programmes via Coursera