Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Cisco 200-901 Exam - Topic 4 Question 105 Discussion

Posted by Tasia on Nov 23, 2025 at 07:41 AM

Which command reverses the last commit without changing the index file or the working tree position?

Suggested Answer: C

The command git reset --soft HEAD^ reverses the last commit but keeps the changes staged in the index file (staging area) and working directory. Here's what the command does:

git reset --soft: Moves the HEAD pointer to the specified commit (in this case, the parent of the current commit, denoted by HEAD^) but leaves the changes from the reset commit in the staging area.

HEAD^: Refers to the parent commit of the current HEAD.

This command is useful when you want to uncommit the last commit but keep the changes for further modification or recommit them.


Git Documentation - git reset

Cisco DevNet Associate Certification Guide

Get Premium 200-901 Questions as Interactive Web-Based Practice Test or PDF Real Exam Format Detailed Explanations Instant Access Get Your Practice Test
30 comments · newest first
GA
Gail 6 months ago
C) is nice for keeping changes, but A) is safer for just reverting.
CH
Christa 7 months ago
I prefer A) too. It’s clear and straightforward.
CE
Celestina 7 months ago
But what about D)? It just says git revert. Is it specific enough?
WA
Wava 7 months ago
A) seems right. It doesn't mess with the index.
VI
Vilma 7 months ago
I feel like C) git reset --soft HEAD^ is also a good option. It keeps changes.
IS
Isreal 7 months ago
No way, it's not D. That's just a general revert command!
ST
Steffanie 8 months ago
Wait, does that really not change the working tree?
TR
Tracey 8 months ago
A makes the most sense to me!
KE
Keena 8 months ago
I thought it was C) git reset --soft HEAD^?
JE
Jerry 8 months ago
I prefer to just use a time machine to undo my commits.
FL
Florinda 9 months ago
B) git reset --hard HEAD~3 is a bit overkill.
CA
Cathrine 9 months ago
D) git revert is the easiest option.
SH
Sheridan 9 months ago
C) git reset --soft HEAD^ is the way to go.
LA
Latosha 9 months ago
I feel like "git reset --soft HEAD^" might be the right answer, but I can't recall if it affects the working tree.
TH
Therese 9 months ago
I remember practicing a question like this, and I think "git revert HEAD" is the one that just creates a new commit.
SH
Sherill 9 months ago
Ah, I got it! The question is asking for a command that reverses the last commit without changing the index or working tree. That means it has to be git revert HEAD. Option A is the answer.
NI
Nikita 10 months ago
I've seen this type of question before. I think the key is to understand that we want to reverse the last commit without affecting the index or working tree. That points me towards option C - git reset --soft HEAD^.
LO
Lon 10 months ago
Wait, I'm a bit confused. Isn't reset used to undo commits? I'm not sure which one is the right choice here.
AR
Arlene 10 months ago
I think it's either A or C, but I'm not entirely sure which one specifically doesn't change the index.
MU
Murray 10 months ago
A) git revert HEAD is the correct answer.
LI
Linn 10 months ago
I think it's A) git revert HEAD. It just undoes the commit.
BR
Brynn 11 months ago
I thought "git revert" was the command that undoes changes without affecting the index, but I'm confused about the options.
OM
Omer 11 months ago
It's definitely A) git revert HEAD.
FL
Florencia 11 months ago
Okay, I think I know this one. I'm pretty sure it's option A - git revert HEAD.
ST
Stevie 11 months ago
Hmm, this one seems tricky. I'll need to think carefully about the differences between reset and revert.
LE
Leandro 6 months ago
↳ replying to Stevie
I’d go with git revert HEAD for this one.
AN
Annmarie 6 months ago
↳ replying to Stevie
Yeah, reset changes the history.
AL
Alfred 6 months ago
↳ replying to Stevie
I think revert is safer for commits.
CR
Cruz 6 months ago
↳ replying to Stevie
Same here! It’s confusing.
LU
Luis 6 months ago
↳ replying to Stevie
I always mix up reset and revert.
0/2000 characters

Save Cancel