How to discard local commits in Git?

后端 未结 6 1129
忘掉有多难
忘掉有多难 2020-12-04 04:44

I\'d been working on something, and decided it was completely screwed...after having committed some of it. So I tried the following sequence:

git reset --har         


        
6条回答
  •  广开言路
    2020-12-04 05:16

    git reset --hard origin/master
    

    will remove all commits not in origin/master where origin is the repo name and master is the name of the branch.

提交回复
热议问题