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

2. Terraform Providers and Module and AWS Setup

This 2 days digital hackathone was a great.

[Algorithms] DPV practice

Launching of Soldex Academy’s Website

How to Build a Simple Web App with React, Graphql, and Go

One More Spin: A Recap of 20 Free Apps in 20 Minutes

Launching Public and Private Subnets in a VPC via Terraform

Running Safient node!

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

Github configuration in local machine

GIT: Objects in GIT

Git: Dealing with Multiple Remote URLs

How to Extract, Decompress Files and Folders from a Zip Archive Automatically with Java