-1

I have did a checkout and the crontab did an entry in one file. I have commited the changes withouth push. Now I want to go back to the last comit before the checkout. Anyone knows how exactly to do this?

Robert-Dan
  • 337
  • 2
  • 4
  • 13

1 Answers1

0

git reset --hard origin/master

This assumes your remote repo has the default local ref origin, and you are on the master branch. To check this you can run git branch -r and you should see something like origin/HEAD -> origin/master as one row in the result.

As the comments rightly point out, the --hard option is going to irrevocably remove any local changes. Be sure this is what you want to do.

gingerbreadboy
  • 7,386
  • 5
  • 36
  • 62