Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Undo changes in git since the last push?

Tags:

git

Newbie question: How do I undo local changes in a git repo back to the last push? I see lots of guidance for rolling back the last commit, or all local changes, but not this case specifically.

like image 997
Abe Avatar asked Dec 06 '11 14:12

Abe


1 Answers

You find the commit to which you want to go back (let's say foo) and then say git reset --hard foo. The next push you do should be a force push if you want it to go through though.

like image 181
Noufal Ibrahim Avatar answered Sep 16 '22 20:09

Noufal Ibrahim