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

  • Home
  • SEARCH
  • 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 8213133
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T11:00:32+00:00 2026-06-07T11:00:32+00:00

I have changes in my working directory that I’m trying to discard (reset to

  • 0

I have changes in my working directory that I’m trying to discard (reset to the current indexed version of the files), however, git checkout -- <file> will not discard the changes.
I’ve attempted to manually remove the files (rm -r files) then run git checkout -- ., which displays the files as modified again.

$ git checkout -- .
$ git status
# On branch master
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#   modified:   files/Hulk.png
#   modified:   files/Hulk_2.png
#
no changes added to commit (use "git add" and/or "git commit -a")

Running git diff shows the files are modified…

diff --git a/files/Hulk.png b/files/Hulk.png
index 1c256cb..1d37fe0 100644
Binary files a/files/Hulk.png and b/files/Hulk.png differ
diff --git a/files/Hulk_2.png b/files/Hulk_2.png
index 1c256cb..0717199 100644
Binary files a/files/Hulk_2.png and b/files/Hulk_2.png differ

NOTE: Some people have said to run git checkout ., however this will achieve the same result as git checkout -- .. The -- is just a notation used in the git checkout command to differentiate treeish/commit points from files/paths.

OS: OSX 10.6
Git: 1.7.10.2

  • 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-07T11:00:33+00:00Added an answer on June 7, 2026 at 11:00 am

    The cause for this was due to multiple files with the same name but different cases. In OSX, which is case-insensitive, doesn’t like multiple files with the same name but different cases. It views them as the same file.
    To fix this, I ran git mv (or just mv) to a temporary filename, added the temp files, which allowed git to remove the old/incorrectly named versions, then a second commit to name them back.
    This could also be corrected on a filesystem which allows different files with the same name to be different cases.

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

Sidebar

Related Questions

I have a git repository (and working directory) that is stored in my Dropbox
I have a dirty working tree, dirty because I made changes to source files
I'm working on asp.net (vb, maybe that can change something) I have a project
Suppose that: I have a repo called MyRepo. I have uncommitted changes in my
I have recently made changes in some code that makes a char name field
By mistake I rm -rf a directory in my git repository. The changes are
When using Mercurial, how do you undo all changes in the working directory since
I have a local branch that I created via git branch --track <localFeatureBranch> <remoteSVNBranch>
I've moved files from Project to Project/src . Git is under the impression that
I have a repo that has two files that supposedly I changed locally. So

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.