Delete commit (staging area) files (git)

Solve the problem is: the extra files submitted to the staging area.

Solution:

View staging area file: git ls-files

Remember the file name you want to delete, delete the file from scratch: git rm --cache file name

If you delete the temporary area can be viewed again file has been deleted, after using the command would normally be deleted.

Consistent with the state for local and remote submission of warehouse: git reset HEAD file name

 

Guess you like

Origin www.cnblogs.com/meina/p/12637906.html