Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 4b8ef73

Browse files
author
Saiful
committed
readme update
1 parent 5339eac commit 4b8ef73

File tree

1 file changed

+33
-5
lines changed

1 file changed

+33
-5
lines changed

‎README.md

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,6 @@ Though there are 1000’s of articles about git, I have written this article is
181181

182182
# Restore all the files of the Workspace.
183183
$ git checkout .
184-
185-
### Undo Commit (Workspace <-- Staging <-- Repository )
186-
187-
# Undo the last commit.
188-
$ git reset HEAD~1
189184

190185
### Revoke/Undo from Staging (Workspace <-- Staging)
191186

@@ -217,6 +212,39 @@ Though there are 1000’s of articles about git, I have written this article is
217212
$ git stash
218213
$ git stash pop
219214

215+
216+
### Revoke/Undo from Staging (Workspace <-- Staging <-- Repository)
217+
218+
# Restore all files from the Repository to the Workspace.
219+
# Remaining the workspace unchanged.
220+
# Undo the last commit.
221+
# Removig arbitary/specific commit is not possible using reset
222+
$ git reset HEAD~1
223+
224+
# Restore specified file from the Staging to the Workspace.
225+
# Remaining the workspace unchanged.
226+
$ git reset [file]
227+
228+
# Reset the Staging and workspace, keeping consistent with the last commit.
229+
$ git reset --hard
230+
231+
# Reset the pointer of the current branch to pointing the specified commit while resetting the Staging, but the workspace remains unchanged.
232+
$ git reset [commit]
233+
234+
# Reset the HEAD of the current branch to the specified commit while resetting the Staging and Workspace, keeping consistent with the specified commit.
235+
$ git reset --hard [commit]
236+
237+
# Reset the current HEAD to the specified commit, remaining the Staging and Workspace unchanged.
238+
$ git reset --keep [commit]
239+
240+
# Create a new commit to undo the specified commit.
241+
# All changes of the latter will be offset by the former and applied to the current branch.
242+
$ git revert [commit]
243+
244+
# Remove the uncommitted changes temporarily and move them in later.
245+
$ git stash
246+
$ git stash pop
247+
220248
### Ignore files and folder
221249

222250
# Delete the files in the Workspace and put this deletion into the Staging.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /