Lucy Weatherford
Lucy Weatherford

Reputation: 5544

Git - Discard changes made to branch

I just started a new branch, but I deleted there one too many files. How do I reinstate the master and delete the changes in the branch? what is the command? Or is it better to just delete the branch and create a new one instead to keep working on a branch before I merge it to the master?

Would git merge master do the trick?

Upvotes: 0

Views: 146

Answers (1)

cexbrayat
cexbrayat

Reputation: 18442

If you want to discard all changes on your branch, you can do :

git reset --hard master

That will reset your branch to the same state as as your master, discarding all changes.

Upvotes: 1

Related Questions