Undo git mv (rename)

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

git mv file1 file2

Solution 1:

Non-cheeky answer:

git mv file2 file1

Updates the index for both old and new paths automatically.

Check documentation of git mv

Solution 2:

If you have done no other changes (that you want to keep) since the last commit, you can do

git reset --hard

Solution 3:

git reset HEAD file2

did the trick for me