---
title: "Discussion on \"Reverting all deletes in Git, leaving file modifications in place\" | Hashnode"
description: "Discussion on \"Reverting all deletes in Git, leaving file modifications in place\". I asked how to do this on StackOverflow, and the answer is:\ngit diff --diff-filter=D --name-only | xargs git checkout\nYou need the \"xargs\": just piping the output of \"diff\" to \"checkout\" doesn't work."
url: "https://hashnode.com/posts/reverting-all-deletes-in-git-leaving-file-modifications-in-place/65c4e9f776fccca84074d6b2"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Reverting all deletes in Git, leaving file modifications in place](https://roderickkennedy.com/reverting-all-deletes-in-git-leaving-file-modifications-in-place?utm_source=hashnode&utm_medium=feed)

I asked how to do this on StackOverflow, and the answer is: git diff --diff-filter=D --name-only | xargs git checkout You need the "xargs": just piping the output of "diff" to "checkout" doesn't work.

Feb 12, 2016 · 1 min read · roderickkennedy.com  
Read the article

## Written by

[Roderick Kennedy](https://hashnode.com/@roderick)

@roderick

  
[View profile](https://hashnode.com/@roderick)

Simulation and Virtual Reality

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
