Exam 701-100 Topic 1 Question 55 Discussion
Actual exam question for Lpi's 701-100 exam
Question #: 55
Topic #: 1
Question #: 55
Topic #: 1
The file index.php, which is being maintained in a git repository, was changed locally and contains an error. If the error has not been committed to the repository yet, which of the following git commands reverts the local copy of index.php to the latest committed version in the current branch?
Suggested Answer: C Vote an answer
The command git checkout -- index.php is used to revert changes made to a file in your working directory. It replaces the local changes with the content of the file as it exists in the latest commit of the current branch.
This is useful when you want to discard local changes that have not been committed yet.
References: Git Documentation - git checkout
This is useful when you want to discard local changes that have not been committed yet.
References: Git Documentation - git checkout
by Tammy at Feb 20, 2026, 10:27 PM
0
0
0
10
Comments
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
Report Comment
Commenting
You can sign-up / login (it's free).