0
  1. Create 2 files: one.txt and two.txt.
  2. Commit both files: git add -A and git commit -m "message"
  3. Edit one.txt and add it to index: git add one.txt
  4. Delete two.txt and add it to index: git rm two.txt

I want to commit only one.txt, therefore I need to reset two.txt from index. How to do it?

git commit one.txt works, but it is not applicable, because may be 100 files instead one.txt.

Aleks Ya
  • 859
  • 5
  • 15
  • 27
  • This is covered in the excellent Pro Git book: [2.4 Git Basics - Undoing Things](http://git-scm.com/book/en/Git-Basics-Undoing-Things) – MBlanc Jun 18 '14 at 11:08

1 Answers1

-1

Command git reset HEAD two.txt reset the file in index and don't touch it in working directory. What you need!

Aleks Ya
  • 859
  • 5
  • 15
  • 27