Developing Applications Using Cisco Core Platforms and APIs (DEVCOR) — Question 344

A developer must apply a new feature on a live project. After the commit, it was discovered that the wrong file was applied. The developer must undo the single commit and apply the file with the name feat-EXP453928854DPS. Which command must the developer use?

Answer options

Correct answer: C

Explanation

The correct command to undo a specific commit while preserving the project history is 'git revert', which creates a new commit that undoes the changes made by the specified commit. 'git clean' is used to remove untracked files, 'git checkout' switches branches or restores working tree files, and 'git reset' can alter commit history and potentially lose changes, which is not ideal in this case.