# Learning git ## Removing Files Removing a file with command `rm file` from your working directory, it will be `unstaged`. `git rm` will remove the file from your tracked files. To keep the file in your working tree but remove it from your staging area, use the `--cached` option. ``` git rm --cached README ``` ## Moving Files ``` git mv file_from file_to ``` Equivalent form is: ``` mv README.md README git rm README.md git add README ``` ## Undoing Things ### commit amend The `git commit --amend` command modififes your latest commit. This command lets you change files in your last commit or your commit message. Your old commit is replaced with a new commit that has its own ID. To change commit message: ``` git commit --amend -m "feat: Revised commit message" ``` To add modified file: ``` git commit --amend --no-edit ```