Git: Undo local changes; git add . + git rm?

后端 未结 2 675

Need help figuring out a couple common workflows with Github. I come from a VS TFS background, so forgive me.

Undoing Pending Changes

Let\'s say

2条回答
  •  孤街浪徒
    2021-02-05 18:10

    You can revert to your last valid commit (i.e. copy of the remote repo, in tour example) by issuing:

    git reset --hard HEAD
    

    Additionally, I suggest reading the useful http://progit.org/2011/07/11/reset.html page to better understand how reset work and what the index is, and why git add and git rm are separate commands.

提交回复
热议问题