Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to undo git update-index?

I just did the following to to keep a different copy of my config.php file in my localhost vs. my production environment:

$ git update-index --assume-unchanged application/config/config.php 

Unfortunately, I didn't write the config.php file exactly as I should and I need to reverse this such that I can make the change, commit it, and then re-ignore the file.

How do I undo the git update-index command?

like image 285
tim peterson Avatar asked Sep 18 '12 16:09

tim peterson


People also ask

How do I undo the latest git add?

To undo git add before a commit, run git reset <file> or git reset to unstage all changes.

How do I undo a git reset?

So, to undo the reset, run git reset HEAD@{1} (or git reset d27924e ). If, on the other hand, you've run some other commands since then that update HEAD, the commit you want won't be at the top of the list, and you'll need to search through the reflog .


1 Answers

git update-index --no-assume-unchanged application/config/config.php 

Notice the --no prefix, stylistically a double negation.

like image 121
CharlesB Avatar answered Sep 25 '22 00:09

CharlesB