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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:43:04+00:00 2026-06-11T01:43:04+00:00

When removing files from a Git repository I accidentally also removed a file that

  • 0

When removing files from a Git repository I accidentally also removed a file that had uncommitted changes.

Reverting the Remove resulted in the file returning without the uncommitted changes. Is there any way of getting back the uncommitted state of the file?

Taking advice from jmort253 heres are the steps…

  1. Made changes to file (it had previously been committed & pushed so
    it is in git)

  2. Using SourceTree, removed some files accidentally
    including the previously mentioned file.

  3. Pushed to origin

  4. Having realised mistake reversed the commit (using SourceTree).

  5. File is now back but it missing the changes made in step 1.

    Hope that helps.

  • 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-11T01:43:06+00:00Added an answer on June 11, 2026 at 1:43 am

    In short : no.
    An uncommited file is (nearly by definition) a file the version control system does not know anything about, so the version control system will no more be able to help you as if you had deleted a random file on your disk (e.g. a file that had never been in the file hierarchy of your repository).

    That is, unless you have a stash on a previous state of your repository that includes the uncommited changes ? (git stash list should give you an idea)

    If you don’t, you should turn to the file recovery methods appropriate for your operating system and filesystem.

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

Sidebar

Related Questions

Possible Duplicate: git - removing a file from source control (but not from the
The resources below describe how to remove sensitive data from a git repository. How
I have a list of changed files in git repository. There is one file
Several posts talk about removing a file or directory from GIT - but they
Something I keep doing is removing comments from a file as I process it.
I have a lot of these in a file jQuery1332199407617=01 that need removing, however,
I got into the habit of removing trailing white spaces from my source file.
I'm trying to import a large subversion repository into git using git-svn (so that
I am having trouble removing files from my main bundle. When I delete them
I'm trying to fetch a read-only git repository from github and have it be

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.