For example, if I changed a file named: sessions_helper_test.rb by mistake. I can type the status of the changes file using the git status command.
$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: test/helpers/sessions_helper_test.rb
no changes added to commit (use "git add" and/or "git commit -a")
I can undo my changes such as deleted file using the git checkout -f command.
$ git checkout -f
Your branch is up-to-date with 'origin/master'.
$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean
No comments:
Post a Comment