Can you explain what git r...
Can you explain what git r...
Git reset is a command used to undo changes and move the repository back to a previous state. It allows you to discard commits, unstage files, and rewrite the commit history. Here's a plain English explanation of what git reset does:
git reset moves the current branch's pointer (usually HEAD) to a specified commit, effectively undoing all commits after that point[1][3].
git reset has three main modes:
--soft
: Only moves the branch pointer, leaving the index (staging area) and working directory unchanged[2][4]. This is useful for undoing a commit while keeping the changes in the staging area.--mixed
(default): Moves the branch pointer, resets the index to match the specified commit, but leaves the working directory unchanged[2][4]. This is the most common usage, as it unstages files but preserves the changes in your working directory.--hard
: Moves the branch pointer, resets the index, and overwrit...senior
Gợi ý câu hỏi phỏng vấn
Chưa có bình luận nào