Studyon Minte9.com
Git




Delete (undo)



1) Undo remove file

	$ cd dev/
	$ rm index2.htm

	$ git status
		# deleted:    index2.htm

	$ git checkout -- index2.htm
		// UNDO remove
		// will recover index2.htm

	
2) Undo remove & commit 


	$ cd dev
	
	$ rm index2.htm
	$ git rm index2.htm
	$ git commit -m "remove index2.htm"

	$ git reset HEAD^1 index2.htm
		// UNDO commit

	$ git checkout -- index2.htm
		// UNDO remove

	$ git status
		# new file:   index2.htm

	$ git commit -m "index2.htm recovered"

3) Git add deleted files

       $ git add -u 
       # automatically stage tracked files (including deleted files)

4) List deleted files
      
       $ git ls-files --deleted


http://stackoverflow.com/questions/492558/removing-multiple-files-from-a-git-repo-that-have-already-been-deleted-from-disk