> For the complete documentation index, see [llms.txt](https://danhnhan-phung.gitbook.io/dnpi/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://danhnhan-phung.gitbook.io/dnpi/master.md).

# Git cheat sheet

## First Aid kit for Git

In case of reverting git push:

```
$ git reset <last functioning commit id> 
$ git stash
$ git push -f origin <branch name>
$ git stash pop
```

{% hint style="info" %}
&#x20;Checkout for more information[: https://stackoverflow.com/questions/1270514/undoing-a-git-push](< https://stackoverflow.com/questions/1270514/undoing-a-git-push>)
{% endhint %}

Changing your name and email globally:

```bash
git config --global user.name=“Phung, Danh-Nhan“
git config —global user.email=“danhnhan.phung@gmail.com"
```

Check your Git configs:

```bash
git config --list
```

Prepare release flow example:

```bash
git checkout release/2.3.0
git tag 2.3.0
git checkout master
git merge release/2.3.0
git push --tags origin master
git branch -d release/2.3.0
```
