Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git staging to working directory?

I have a question concerning the git reset command:

git reset .
git reset HEAD .

What is the difference between the two commands? Are making same changes?

like image 715
Balasekhar Nelli Avatar asked Jul 22 '26 23:07

Balasekhar Nelli


2 Answers

Yes, it does exactly the same. If you omit the commit id, it will default to HEAD.

like image 111
Zbynek Vyskovsky - kvr000 Avatar answered Jul 25 '26 14:07

Zbynek Vyskovsky - kvr000


  1. Git Reset: to undo commits:

    • --soft (does not change stage index or working directory)
    • --mixed (default) (changes stage index to match repository)
    • --hard (change stage index and working directory)

Example: git reset "hashValueOfAnyCommit"

  1. Git Reset HEAD: Unstage file from your stage
like image 24
Nima Saed Avatar answered Jul 25 '26 15:07

Nima Saed



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!