Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8754411
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T13:36:52+00:00 2026-06-13T13:36:52+00:00

I brought the last ‘good’ commit down to my local repository by doing: git

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T13:36:53+00:00Added an answer on June 13, 2026 at 1:36 pm

    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.

    1. Clone the remote repository locally and then copy files from that local copy to your repo.

    2. Run git fetch to update your remote. Then you can do something like git origin/master:show path/to/file.ext > path/to/file.ext to get individual files locally.

    Then you can just add the files and push as you mentioned. (You’ll have to give push the -f option since you’re changing the remote history.) You probably want to keep a backup of the remote branch just in case.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I had a clean working directory and brought in a clone from a Git
Repository A: migrated to git from a project's SVN at revision r : cloned
Something really strange is going on here. I bought a new Mac last week,
Someone brought up the MySQLi multi_query function in an answer claiming that it would
I brought up a point about obfuscation in another question to which someone replied
I was brought in on a legacy codebase to upgrade it from Rails 2.4/Ruby
A friend brought this to my attention, and after I pointed out an oddity,
I've been brought in as an intern to develop a SharePoint site. My team
Importing a Maven project into Eclipse has brought up the error: Plugin execution not
I have a client who has brought in another developer to work on a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.