How to Undo Git Commits, Rename a Git Branch and Checkout a Previous Commit
Offered By: Dave Gray via YouTube
Course Description
Overview
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 ToolboxJohns 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