git
newbie here, used to subversion
:
I have some local changes that I've committed and now wanted to push but I got:
$ git push
Everything up-to-date
after a quick Google search, I found: git push says everything up-to-date even though I have local changes and I thought GREAT! and started following the recommendation in the accepted answer:
$ git log -1
#got the hash key
$ git checkout master
M util/logging/cp_logging.cpp
Already on 'master'
Your branch is up-to-date with 'origin/master'.
#Now I got nervous and verified with git status
#and git diff that my changes were still there
#just for safety I did a
$ git diff >save.patch
#followed by(as recommended):
$ git reset --hard 579823db25d2a821c2940608e9cb8122c2779b37
HEAD is now at 579823d Merge remote-tracking branch 'upstream/master'
#then I did a
$ git status
# and realized that my changes were gone!
How do I get my changes (luckily saved save.patch) get back into my local working copy and then push the changes to the online repo from here? Should my changes not be committed in my local repo already (as I did a git commit
earlier)?