Undo git mv (rename)

jrdioko picture jrdioko · Feb 4, 2011 · Viewed 57.9k times · Source

What is the right way to undo a rename in git, like:

git mv file1 file2

Answer

CanSpice picture CanSpice · Feb 4, 2011

Non-cheeky answer:

git mv file2 file1

Updates the index for both old and new paths automatically.

Check documentation of git mv