Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Undo changes made in a specific folder in Git

Tags:

git

How I can undo changes made in a specific folder?

I've modified files from multiple folders like

app/code/core/ app/code/local/ app/design/frontend/ 

I want to undo all the changes made in files present in app/code/core/, while keeping the changes modified in files present in app/code/local/ and app/design/frontend/.

like image 486
amitshree Avatar asked Jun 15 '15 11:06

amitshree


People also ask

How do I remove changes to a specific file in git?

Try Git checkout --<file> to discard uncommitted changes to a file. Git reset --hard is for when you want to discard all uncommitted changes. Use Git reset --hard <commit id> to point the repo to a previous commit.

How do I undo a local change in github?

To revert changes made to your working copy, do this: git checkout . Or equivalently, for git version >= 2.23: git restore .


1 Answers

If you want to undo the changes, do git checkout app/code/core/

like image 98
David Deutsch Avatar answered Oct 17 '22 04:10

David Deutsch