Git Tutorial: How to Undo Git Commits, Rename a Git Branch and Checkout a Previous Commit
Video Statistics and Information
Channel: Dave Gray
Views: 665
Rating: undefined out of 5
Keywords: git, git tutorial, git commit, git branch, git merge, undo commits, rename branch, merge branch, git revert, git reset
Id: EGooeHH3hDY
Channel Id: undefined
Length: 33min 49sec (2029 seconds)
Published: Fri Aug 21 2020
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.
Undoing git mistakes can be difficult if you don't know how. This video steps through examples of how you can undo all types of actions in git as well as explaining git branches and merges. Full outline and timestamps below!
🕓 Outline with timestamps:
(0:04) Recap Quick Start
(1:20) git restore [filename] (undo changes)
(2:18) git restore --staged [filename] (undo staged files)
(3:09) git log (show log with details)
(3:45) git log --oneline (shows simplified log)
(4:35) git commit -v --amend (change last commit's message)
(6:35) git branch [newBranchName] (creates new branch)
(7:50) git branch --list (lists all branches)
(8:05) git checkout [branchName] (switch to this branch)
(8:10) working with more than one branch
(12:25) git branch -m [oldBranchName] [newBranchName] (renames branch)
(14:10) git checkout -b [newBranchName] (creates new branch and switches to it)
(15:00) git branch -D [branchName] (deletes branch permanently)
(16:00) git merge [branchName] (merges named branch into branch you are on)
(17:10) Understanding and handling git merge conflicts
(22:30) git checkout [commitNumber] (go back to a specific commit number)
(27:00) git revert [commitNumber] (revert code to a specific commit number by creating new commit)
(29:30) git reset [commitNumber] (reset code to a specific commit number and unstage the code that came after that commit)
(31:45) git reset [commitNumber] --hard (reset code to a specific commit and permanently delete the code that came after the commit)
Git Tutorial: How to Undo Git Commits, Rename a Git Branch and Checkout a Previous Commit: https://youtu.be/EGooeHH3hDY