-1

Warning: I'm a complete newb to GIT and programming in general.

I have a GIT project (my own project that no one else works on). I only have one branch (master).

I made some big mistakes in my project and I want to go back to some commits from November 13. I have one particular commit, let's call it 30b1234, that I want to roll back my project to.

From my research, I've discovered doing get reset --hard 30b1234 resets my local machine to 30b1234. Great!

Now I work on my local copy, get everything work great again and I go to push my local changes to the origin/master and I get the error that " Updates were rejected because the tip of your current branch is behind". This makes sense to me - I reverted my local version but the GIT master is still at some other version.

So my question: How do I rollback to an older commit both locally and in the origin?

1 Answers1

0

I go to push my local changes to the origin/master

Do the push again, and this time include the --force modifier.

matt
  • 515,959
  • 87
  • 875
  • 1,141