I brought the last ‘good’ commit down to my local repository by doing:
git checkout the_SHA_I_wanted
git reset --hard
I am now missing my teammate’s changes, affecting only 4 files (luckily). How can I grab the latest version of her four files from the remote repository and use them to ‘replace’ (overwrite) those 4 files in my local repository? (or, what is this procedure called, so I can research it?) After that, I plan to push up to the remote without pulling.
We are not git-savvy, so would it be easier to manually copy her files directly into my xCode project and, as I said before, do a push without pulling?
If it’s just four files and the problem is solved by copying them, then you’ve already answered your own question. Suppose you did want to pull those four files from the remote repository. You have a couple of options.
Clone the remote repository locally and then copy files from that local copy to your repo.
Run
git fetchto update your remote. Then you can do something likegit origin/master:show path/to/file.ext > path/to/file.extto get individual files locally.Then you can just add the files and push as you mentioned. (You’ll have to give push the
-foption since you’re changing the remote history.) You probably want to keep a backup of the remote branch just in case.