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

后端 未结 15 1562
野的像风
野的像风 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:03

    You don't have to force yourself to remember differences between them. Think of how you actually made a commit.

    1. Make some changes.

    2. git add .

    3. git commit -m "I did Something"

    Soft, Mixed and Hard is the way enabling you to give up the operations you did from 3 to 1.

    • Soft "pretended" to never see you have did git commit.
    • Mixed "pretended" to never see you have did git add .
    • Hard "pretended" to never see you have made file changes.

提交回复
热议问题