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 8765713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T16:21:28+00:00 2026-06-13T16:21:28+00:00

I got a Git repository that I accidentally pushed a file 4 commits ago

  • 0

I got a Git repository that I accidentally pushed a file 4 commits ago that is located in (path relative to the repository root folder): /Core/C:/testoutput/agwqe1s.xml

I did this on my Linux machine, so the actual file was created without any problem. The thing is when I go back to my Windows machine, I can’t switch to the branch that has this file because the Windows just refuses to create such a folder. Ok, no problem, I deleted the file on my Linux end and commit it, but even tough it’s not working. Git still tries to create this illegal file on my Windows machine, and I don’t know what to do.

I know that I could remake the repo from scratch, but then I’d lost my whole commit log history, and I wanted to avoid that. What are my options over here?

  • 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-13T16:21:30+00:00Added an answer on June 13, 2026 at 4:21 pm

    you don’t need to checkout that branch to update it. From a branch that works do this:

    git fetch
    git push . origin/problembranch:problembranch
    git checkout problembranch
    

    the trick is to push to the same repository. That’s what the . is for.

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

Sidebar

Related Questions

I've got a Git repository with plenty of commits that are under no particular
I've got a Git repository that has some files with DOS format ( \r\n
We were sharing a GIT repository via file-sharing system (smb://) and got it badly
I've got a project in a git repository that uses some custom (and so
Our central git repository got in a weird state after a commit that involved
Somewhere along the line, some huge, huge file got added to the git repository
I've got a git repository with two branches, master and amazing_new_feature . The latter
I've got bonobo git server that's supposed to handle syncing among at least 2
Has anyone got a script for git that can go through the history, check
There is a master subversion repository that I've cloned a git repo from. I've

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.