What is the difference between git reset and git revert?

前端 未结 2 1111
后悔当初
后悔当初 2021-02-14 08:25

Hi I am a newbie to git and I don\'t understand what is the basic difference between git reset and git revert. Does git revert reverts the

2条回答
  •  伪装坚强ぢ
    2021-02-14 08:38

    Git reset -->move the tip of a branch to a different commit. This can be used to remove commits from the current branch. It moves the branch backwards by commits. Git Revert-->undoes a commit by creating a new commit. This is a safe way to undo changes, as it has no chance of re-writing the commit history.

提交回复
热议问题