git undo commits example

preview_player
Показать описание
How do you undo git commits? There are two ways depending upon what exactly you are trying to accomplish. This git undo commit example demonstrates how to use both the reset and revert commands to accomplish the goal, and it points out the difference between the two approaches.
Рекомендации по теме
Комментарии
Автор

Hi Cameron, love your git tutorials! In the example the third commit is kinda independent from the second commit so the revert can just safely take away the second file. What happens if the third commit actually develops from the second commit, making changes to the second file, and adds the third file, and then we call revert?

dianchen
Автор

HI, will revert and reset also works if we use only 1 file and modify it 5 times and revert and reset 3rd commit ?

ajaydhiman