200-901 · Question #631
A developer is working on a feature named 'dvft4e8f5g0e3k3d6e8f1v1' in a branch. A file named 'dvft264744863v1.jpg' has been staged accidentally. To ensure that the commit is performed and branches…
The correct answer is B. git reset HEAD dvft264744863v1.jpg. The git reset HEAD <file> command is used to unstage a file that has been added to the staging area. In this case, the command git reset will unstage the file dvft264744863v1.jpg while keeping the changes in the working directory. This allows the HEAD dvft264744863v1.jpg…
Question
A developer is working on a feature named 'dvft4e8f5g0e3k3d6e8f1v1' in a branch. A file named 'dvft264744863v1.jpg' has been staged accidentally. To ensure that the commit is performed and branches are merged the developer needs to remove it. Which Git command must be used to unstage the file?
Options
- Agit delete HEAD dvft264744863v1.jpg
- Bgit reset HEAD dvft264744863v1.jpg
- Cgit revert HEAD dvft264744863v1.jpg
- Dgit remove HEAD dvft264744863v1.jpg
How the community answered
(24 responses)- B96% (23)
- C4% (1)
Explanation
The git reset HEAD <file> command is used to unstage a file that has been added to the staging area. In this case, the command git reset will unstage the file dvft264744863v1.jpg while keeping the changes in the working directory. This allows the HEAD dvft264744863v1.jpg developer to proceed with the commit without including the accidentally staged file.
Topics
Community Discussion
No community discussion yet for this question.