Batch undo git modifications

The following command can be used to find and checkout (undo) all files with modifications:

git checkout $(git ls-files -m)

This is effectively an “undo” of all modifications in the given branch (but it doesn’t impact added or deleted files).

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Modules in Python

Goldfinch-Flight Academy

Triumph through failure

Cristian Oliveira Da Rosa

Here’s the CSS to Change Your Operating System’s Design

Dynamic Bundling-Trials in performance

How to delete Linux/second os boot file from windows boot partition.

A simple way to set Devise with Omniauth2.0 (Facebook, Google)

Soartex Fanver & It’s Future

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Praj Basnet

Praj Basnet

More from Medium

Stacks and Queue Data Policy in C# programming

Setup Docker Container as Test environment in Local Development using shell script

Git : Introduction

Multimodule Projects in Git Part2: Handling Subprojects Using Branching