What's the difference between git reset --mixed, --soft, and --hard?

后端 未结 15 1456
野的像风
野的像风 2020-11-22 14:39

I\'m looking to split a commit up and not sure which reset option to use.

I was looking at the page In plain English, what does "git reset" do?, but I real

15条回答
  •  無奈伤痛
    2020-11-22 15:15

    In the simplest terms:

    • --soft: uncommit changes, changes are left staged (index).
    • --mixed (default): uncommit + unstage changes, changes are left in working tree.
    • --hard: uncommit + unstage + delete changes, nothing left.

提交回复
热议问题