Last answered:

16 Nov 2022

Posted on:

21 May 2021

0

git checkout vs git reset

It's not clear what the difference between the two? When should we use one command or the other? Thanks in advance

1 answers ( 0 marked as helpful)
Posted on:

16 Nov 2022

0

use soft command when you want to move HEAD to previous commit and at the same time the changes would be staged.
Use mixed command when you want to move HEAD to some previous commit and at the same time the changes would be unstaged.
And use hard command when you want to move HEAD to some previous commit and also to go back to previous version of the file.

Submit an answer