Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'doc/university/training/topics/rollback_commits.md')
-rw-r--r--doc/university/training/topics/rollback_commits.md12
1 files changed, 6 insertions, 6 deletions
diff --git a/doc/university/training/topics/rollback_commits.md b/doc/university/training/topics/rollback_commits.md
index 333b2f23a1b..616ed972ab0 100644
--- a/doc/university/training/topics/rollback_commits.md
+++ b/doc/university/training/topics/rollback_commits.md
@@ -8,25 +8,25 @@ comments: false
- Undo last commit putting everything back into the staging area:
- ```sh
+ ```shell
git reset --soft HEAD^
```
- Add files and change message with:
- ```sh
+ ```shell
git commit --amend -m "New Message"
```
- Undo last and remove changes:
- ```sh
+ ```shell
git reset --hard HEAD^
```
- Same as last one but for two commits back:
- ```sh
+ ```shell
git reset --hard HEAD^^
```
@@ -47,7 +47,7 @@ comments: false
## Commands
-```sh
+```shell
# Change file edit_this_file.rb
git status
git commit -am "kjkfjkg"
@@ -66,7 +66,7 @@ git push origin master
- Reset removes the commit while revert removes the changes but leaves the commit
- Revert is safer considering we can revert a revert
-```sh
+```shell
# Changed file
git commit -am "bug introduced"
git revert HEAD