You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Restore the specified file of the Staging to the Workspace.
196
+
$ git checkout [file]
197
+
198
+
# Restore the specified file of a certain commit to the Staging and Workspace.
199
+
$ git checkout [commit] [file]
200
+
201
+
# Restore all the files in the Staging to the Workspace.
202
+
$ git checkout .
203
+
204
+
# Reset the specified file in the Staging, keeping consistent with the previous commit, but remaining the workspace unchanged.
205
+
$ git reset [file]
206
+
207
+
# Reset the Staging and workspace, keeping consistent with the last commit.
208
+
$ git reset --hard
209
+
210
+
# Reset the pointer of the current branch to pointing the specified commit while resetting the Staging, but the workspace remains unchanged.
211
+
$ git reset [commit]
212
+
213
+
# Reset the HEAD of the current branch to the specified commit while resetting the Staging and Workspace, keeping consistent with the specified commit.
214
+
$ git reset --hard [commit]
215
+
216
+
# Reset the current HEAD to the specified commit, remaining the Staging and Workspace unchanged.
217
+
$ git reset --keep [commit]
218
+
219
+
# Create a new commit to undo the specified commit.
220
+
# All changes of the latter will be offset by the former and applied to the current branch.
221
+
$ git revert [commit]
222
+
223
+
# Remove the uncommitted changes temporarily and move them in later.
224
+
$ git stash
225
+
$ git stash pop
173
226
174
227
### Ignore files and folder
175
228
@@ -210,40 +263,6 @@ Though there are 1000’s of articles about git, I have written this article is
210
263
$ git checkout -b [branch] [tag]
211
264
212
265
213
-
### Revoke
214
-
215
-
# Restore the specified file of the Staging to the Workspace.
216
-
$ git checkout [file]
217
-
218
-
# Restore the specified file of a certain commit to the Staging and Workspace.
219
-
$ git checkout [commit] [file]
220
-
221
-
# Restore all the files in the Staging to the Workspace.
222
-
$ git checkout .
223
-
224
-
# Reset the specified file in the Staging, keeping consistent with the previous commit, but remaining the workspace unchanged.
225
-
$ git reset [file]
226
-
227
-
# Reset the Staging and workspace, keeping consistent with the last commit.
228
-
$ git reset --hard
229
-
230
-
# Reset the pointer of the current branch to pointing the specified commit while resetting the Staging, but the workspace remains unchanged.
231
-
$ git reset [commit]
232
-
233
-
# Reset the HEAD of the current branch to the specified commit while resetting the Staging and Workspace, keeping consistent with the specified commit.
234
-
$ git reset --hard [commit]
235
-
236
-
# Reset the current HEAD to the specified commit, remaining the Staging and Workspace unchanged.
237
-
$ git reset --keep [commit]
238
-
239
-
# Create a new commit to undo the specified commit.
240
-
# All changes of the latter will be offset by the former and applied to the current branch.
241
-
$ git revert [commit]
242
-
243
-
# Remove the uncommitted changes temporarily and move them in later.
244
-
$ git stash
245
-
$ git stash pop
246
-
247
266
248
267
### Others
249
268
@@ -252,7 +271,14 @@ Though there are 1000’s of articles about git, I have written this article is
0 commit comments