Undo a Commit on Git

preview_player
Показать описание
If you did a commit but there's still something to add, or you simply want to remove it, here you can find 4 different ways by using amend and reset for different scenarios.

git commit --amend is a nice way to update an existing state, while git reset can be useful for removing a commit and/or deleting the changes entirely.

Bonus: at the end, we'll also see how to restore something after a hard reset.
_______________________________
Hit like and subscribe for more content! :D

You can also follow me on the other platforms:
_______________________________
TIMESTAMPS
00:00 Add files to an existing commit
01:28 Change commit message
02:39 Remove commit & keep changes
04:01 Remove commit & delete changes
05:10 Restore after hard reset

#git #commit #reset
Рекомендации по теме
Комментарии
Автор

Don't forget that you can use the TIMESTAMPS in the video to see all 4 different methods... plus a bonus at the end, how to get back your changes after a git reset HARD.
Thank you for watching!

DevLeonardo
Автор

Ciao, mi chiamo Emanuele Gurini e sono tuo fan.

emanuelegurini
Автор

Thank you for the vidoe.

What's the auto-complete feature you're using? I used to know what it is, but I forgot!

farzadmf