How to discard local commits in Git?

后端 未结 6 1121
忘掉有多难
忘掉有多难 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:18

    You need to run

    git fetch
    

    To get all changes and then you will not receive message with "your branch is ahead".

提交回复
热议问题