What is the difference between “git reset --hard” and “git checkout .”?

后端 未结 3 1568
心在旅途
心在旅途 2021-01-19 02:47

When I want some changes in my project and I want to return to the state of the last commit, I can use these both options. Do they actually do the same thing or is there any

3条回答
  •  佛祖请我去吃肉
    2021-01-19 03:46

    git checkout get update data from Git server, also keep your change at local machine.

    git reset --hard make a copy identity like Git server at a specific HEAD, and discard all change at your local machine.

提交回复
热议问题