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 f0ac172

Browse files
author
Saiful
committed
Revoke/Undo from Workspace
1 parent f1ea4cb commit f0ac172

File tree

1 file changed

+12
-23
lines changed

1 file changed

+12
-23
lines changed

‎README.md

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ Though there are 1000’s of articles about git, I have written this article is
4747
5- $ git remote add origin github.com/saifaustcse/new_repository
4848
6- $ git push -u origin master
4949

50-
5150
### Adding files and folder (Workspace --> Staging)
5251

5352
# Add the specified file from the current directory to the staging.
@@ -63,7 +62,6 @@ Though there are 1000’s of articles about git, I have written this article is
6362
$ git reset HEAD .
6463
$ git reset HEAD [file_name]
6564

66-
6765
### Commit changes (Staging --> Repository)
6866

6967
# Submit the code from the staging to the Repository with a message
@@ -75,7 +73,6 @@ Though there are 1000’s of articles about git, I have written this article is
7573
# Display all diff information when submitting.
7674
$ git commit -v
7775

78-
7976
### Commit changes (Workspace --> Staging --> Repository)
8077

8178
# Submit the changes of all tracked files after the last commit.
@@ -84,19 +81,12 @@ Though there are 1000’s of articles about git, I have written this article is
8481
# For untracked file
8582
$ git add .
8683
$ git commit -am [message]
87-
88-
89-
### Undo Commit (Workspace <-- Staging <-- Repository )
90-
91-
# Undo the last commit.
92-
$ git reset HEAD~1
9384

9485
### Remote synchronization from Repository(Repository --> Remote)
9586

9687
# Push the current branch to the Remote Repository.
9788
$ git push origin [branch]
9889

99-
10090
### Repository synchronization from remote (Repository <-- Remote)
10191

10292
# Download specific branch.
@@ -105,7 +95,6 @@ Though there are 1000’s of articles about git, I have written this article is
10595
# Download all remote branches.
10696
$ git fetch --all
10797

108-
10998
### Workspace synchronization from Repository (Workspace <-- Repository)
11099

111100
# merge the specified branch to the current branch.
@@ -114,13 +103,11 @@ Though there are 1000’s of articles about git, I have written this article is
114103
# merge a branch into a target branch
115104
$ git merge [source branch] [target branch]
116105
117-
118106
### Workspace synchronization from remote (Workspace <-- Repository <-- Remote)
119107

120108
# Retrieve the changes to the Remote Repository and merge with the local branch (fetch+merge)
121109
$ git pull origin [branch]
122110

123-
124111
### Branching
125112

126113
# List all local branches. (the asterisk denotes the current branch)
@@ -151,7 +138,6 @@ Though there are 1000’s of articles about git, I have written this article is
151138
$ git push origin --delete [branch-name]
152139
$ git branch -dr [remote/branch]
153140
154-
155141
### Inspection
156142

157143
# Display the changed files.
@@ -187,19 +173,23 @@ Though there are 1000’s of articles about git, I have written this article is
187173
* [Atlassian](https://www.atlassian.com/git/tutorials/git-log)
188174
* [Thegeekstuff](https://www.thegeekstuff.com/2014/04/git-log/)
189175

190-
191176

192-
### Revoke
177+
### Revoke/Undo from Workspace
193178

194-
# Restore the specified file of the Staging to the Workspace.
179+
# Restore the specified file of the Workspace.
195180
$ git checkout [file]
196181

197-
# Restore the specified file of a certain commit to the Staging and Workspace.
198-
$ git checkout [commit] [file]
199-
200-
# Restore all the files in the Staging to the Workspace.
182+
# Restore all the files of the Workspace.
201183
$ git checkout .
202184

185+
186+
### Undo Commit (Workspace <-- Staging <-- Repository )
187+
188+
# Undo the last commit.
189+
$ git reset HEAD~1
190+
191+
### Revoke/Undo from Staging (Workspace <-- Staging)
192+
203193
# Reset the specified file in the Staging, keeping consistent with the previous commit, but remaining the workspace unchanged.
204194
$ git reset [file]
205195

@@ -221,8 +211,7 @@ Though there are 1000’s of articles about git, I have written this article is
221211

222212
# Remove the uncommitted changes temporarily and move them in later.
223213
$ git stash
224-
$ git stash pop
225-
214+
$ git stash pop
226215

227216
### Ignore files and folder
228217

0 commit comments

Comments
(0)

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