What am i doing wrong?(reset II)


#1

i typed

  git reset 9264b0e

but when i log again the commit is still there...
and i also get the error message called 'Did you copy the first 7 characters of a commit SHA and paste them after the git reset command?'

but i checked SHA and i copied it right..
pls help i'm stuck


#2

to me, it now looks like you used 5 characters of the SHA string/key, 7 seems to be the minium


#3

@stetim94 edited the question sry


#4

can i see the output of git log? And a screenshot would also be really nice. If you reset to the latest commit, the latest commit isn't deleted, it simple reset the staged files


#5

@stetim94 added a screenshot


#6

super weird, that should work. what if you try a earlier one:

git reset eaafdae505e61

i know, that are more then 7 char, but should work


#7

@stetim94 OMG this thing is super super weird now after i tried reseting the second commit 'the larry one' and when i logged again it reseted my 1st commit anyway i can move on
thanks for your help


#8

yes, that is the whole point of a reset. Later commits are deleted. Only if you reset to the latest commit, the commit stays, the files are simple unstaged (staged files are files you added with git add)


#9

@stetim94 oh so reset sends you to the back in time to commit you mentioned in the command thnx..


#10

Yes, which is really useful when you mess up big time, you can go back in time :smiley: that is why the commit messages are so important, so you remember what you did at which point, if you edit a lot of files, doing git diff can be a lot of work