-1

I want to discard all files to which changes have been made.

While working with Xcode, I accidentally open .xib files. If the version of Xcode in which the files were generated is different than my version, it automatically marks these files as Modified (M) and it shows up in my git as well. I need to manually remove all of the file. I'm sure there must be a better way to do it.

javaProgrammer
  • 1,185
  • 1
  • 10
  • 11
  • Does this answer your question? [git checkout all the files](https://stackoverflow.com/questions/29007821/git-checkout-all-the-files) – Liam Aug 26 '22 at 15:40

2 Answers2

1
git reset --hard

will reset to the committed state,

git checkout -- .

will check out the staged state

jthill
  • 55,082
  • 5
  • 77
  • 137
0

Select the .xib files in question, right click/control-click on your selection, and select the "Discard changes in selected files" option. This will revert the files back to their stored versions (it's the equivalent of the git checkout command in that it removes the file from the list of changed files)

For safety, I tend to view the xib files in Version mode to ensure that only the Xcode version boilerplate is changing before I do this.

weaselfloss1
  • 139
  • 1
  • 4