Home ›
Restore locally deleted files with gitRestore locally deleted files with git
Submitted by Benjamin Melançon on April 27, 2009 - 5:46am
In SVN, running svn update will restore any files you have deleted locally where you have not explicitly committed the removal. Not so in git (or at least git-svn) for removed or moved files.
The tip found will restore not just one, but every deleted file. Agaric recommends you check what you're restoring with just git ls-files -d (where -d stands for --delete) first.
git ls-files -d | xargs git checkout --
Resolution
Searched words:
git restore locally deleted file
Comments
git ls-files -d -z | xargs -0 git checkout --
git ls-files -d -z | xargs -0 git checkout --
It works fine, but git update
It works fine, but
git update -- .
is even simpler.
Post new comment