Undo Git Commit Amend So You Can Make a Separate Commit

preview_player
Показать описание
This helps break apart 2 commits without having to re-do the first commit.

Hit the subscribe button to receive more videos like this!

REFERENCE LINKS
---------------------------------------------------

COURSES
---------------------------------------------------
Courses I've created that focus on web dev and deployment topics.

THE TOOLS I USE / GEAR
---------------------------------------------------

FOLLOW ME ELSEWHERE
---------------------------------------------------

TIMESTAMPS
---------------------------------------------------
0:00 -- Intro
0:23 -- Showing the problem
1:07 -- Solving this in an inefficient way
2:28 -- Solving it in a better way
3:23 -- Taking a look at reflog and the differences between the 2
Рекомендации по теме
Комментарии
Автор

The difference between the 2 notations is that HEAD~1 goes 1 commit back of the commit log, and HEAD@{1} goes one step back in the history of the git repo (aka reflog), quite useful also when you mess up an interactive rebase that changed a dozen commits for example.

balloth
Автор

13.5 years using Git and apparently I still have much to learn. This would have been handy at least 50 times or so...

drevan
visit shbcf.ru