Git reset hard vs soft: What's the difference?

preview_player
Показать описание
When you do a git reset, you have two options:

- git reset hard
- git reset soft

So, which one should you choose?

Well, the difference between git reset hard vs soft comes down to what happens to the files in your Git worktree, or workspace, or whatever you want to call it.

With git reset soft, your files are left alone, while a git reset hard resets the files on the filesystem as well.

I always do a git reset hard instead of a git reset soft.
Рекомендации по теме
Комментарии
Автор

I love this.
I also prefer the git reset --hard e09fhs38

sleeksilk
Автор

Why do you prefer git reset --hard if you can lose the changes ?

prateekrajput
Автор

Simple look at soft and hard git resets.

ivanphone