Skip to main content
The 2024 Developer Survey results are live! See the results
12 of 16
Explain how to keep changes.
Daniel Alexiuc
  • 13.2k
  • 9
  • 59
  • 73

Just do this:

git checkout master

If you have changes that you want to keep, do this instead:

git checkout -b temp
git branch -f master temp
git checkout master
Daniel Alexiuc
  • 13.2k
  • 9
  • 59
  • 73