0

I searched and found many link which talks about un-doing your uncommited changes with respect to specific file:

  1. git reset
  2. git reset --hard
  3. git checkout -- file
  4. git checkout branchname^ filename

but I want to undo changes for all the files I have modifies under a specific folder.

assume I have a folder like this clients/libs/slickgrid & slickgrid internally contains multiple folder which contains multiple files.

I want to undo all modified files under slickgrid folder. What options I have over here?

SharpCoder
  • 18,279
  • 43
  • 153
  • 249

1 Answers1

0

git reset HEAD clients/lib/slickgrid

if they are already part of git's history you also then have to do

git checkout clients/lib/slickgrid

Jed Schneider
  • 14,085
  • 4
  • 35
  • 46
  • I have not commited the files so far : running `git checkout clients/lib/slickgrid` gives `error: pathspec 'clients/lib/slickgrid' did not match any file(s) known to git.` If I run `git reset HEAD clients/lib/slickgrid` and then run `git status` I can still see all the files – SharpCoder May 29 '15 at 13:51
  • if there is nothing to checkout of git then you haven't changed files that are being tracked. run `git status` you'll see that git specifies those files are untracked. You will see `Untracked files: (use "git add ..." to include in what will be committed) foo.js` assuming your file untracked is foo.js. if they are not tracked then there is no way to revert changes. Does that make sense? – Jed Schneider May 29 '15 at 20:16