About the author

My photo

Java, Scala, and everything

Thursday, August 14, 2014

Git reset soft/mixed/hard

What is the difference between git reset soft, mixed and hard? When doing reset in git, you can add --soft, --mixed or --hard switch, or leave it, --mixed is the default. What do this switches do?

  1. Code before changes
  2. Code after changes
  3. Changes staged on index
  4. Changes commited

Now if you issue

git reset --xxxx HEAD~1

--soft moves you back to (3), --mixed to (2) and --hard to (1)

Written with StackEdit.

1 comment:

Mrs Sharon Sim said...

Hello Everybody,
My name is Mrs Sharon Sim. I live in Singapore and i am a happy woman today? and i told my self that any lender that rescue my family from our poor situation, i will refer any person that is looking for loan to him, he gave me happiness to me and my family, i was in need of a loan of S$250,000.00 to start my life all over as i am a single mother with 3 kids I met this honest and GOD fearing man loan lender that help me with a loan of S$250,000.00 SG. Dollar, he is a GOD fearing man, if you are in need of loan and you will pay back the loan please contact him tell him that is Mrs Sharon, that refer you to him. contact Dr Purva Pius,via email:(urgentloan22@gmail.com) Thank you.