Cauder
Cauder

Reputation: 2637

Accidentally did git up and then git push

I did git up and then git push on my branch. Now, I have all the changes I made plus all the changes everyone else made and so my push includes hundreds of commits.

My understanding is that git revert [commit number] lets me undo commits, but then I would have to run that hundreds of times for each of the changes.

Is there a way to undo the whole commit?

Upvotes: 0

Views: 61

Answers (1)

natt
natt

Reputation: 127

Look at git reset. The third form allows you to set the current branch to a specific commit (where it was before you pulled in everyone else's changes). Git log will give you the history of the branch so you can find the commit you want to reset to.

Upvotes: 1

Related Questions