Developing Applications and Automating Workflows Using Cisco Platforms (DEVASC) — Question 425

A developer is working on a new feature named ‘feat434370483’ in a branch. A file named ‘devasc321345515.jpg’ has accidentally been staged. The developer needs to remove this so that the commit is performed and branches are merged. Which Git command must be used to unstage the file?

Answer options

Correct answer: B

Explanation

The correct answer is B, 'get reset HEAD devasc321345515.jpg', which is the command used to unstage files in Git. Option A is incorrect because 'get delete' is not a valid Git command, C is wrong as 'git remove' does not exist in Git, and D is also incorrect since 'git revert' is used to undo commits, not to unstage files.